Not sure I know what I'm talking about, but I'm at least I'm trying to help, and a start conversation toward solution:
The motion sensor 'switch' is it switching
1)hot (black) or
2_Neutral (white)?
and the wiring from the motion switch to the LED transformer is it polarized consistently...