Maybe either the threads are broken on one or other end, or the ceiling was skimmed after the fitting was up.
Or perhaps it was broken and replaced with a non matching one.
If it really won't stay, and you're confident with electrics, isolate the power completely and take a not of the wiring, then replace the whole ceiling fitting with a matching one.
Only a few pounds.