Power in circuit fading away after a few seconds
If it works for a few seconds then stops, and disconnecting and reconnecting it after a few seconds, it tends to be a power supply in current overload or short circuit protection mode. If the leds work with the original controller, then it's your circuit.

So replace the power supply. If that doesn't work, recreate your circuit with new mosfets. If it still doesnt, check your code or raspberry pi.