Hi UGS,
Have you solved your problem? If not, please look for a proximity sensor on the axis. In my machines, I have a proximity which tells the machine whether it had to reference forward or backwards based on where the axis is at the time of switch on. If the proximity is ON, that means the axis is ahead of the reference marker and would hit the dead stop before it references, it would go in the direction opposite what it would usually. This is the normal logic for machines with rotary axes wherein the travel is not infinite.
There are two possible failure points-
1. Proximity might be in bad condition or physically contaminated causing wrong signal feedback
2. .There might be an electrical short circuit or noise in the system causing wrong feedback
3. The proximity mount may have become loose and shaking around
Best of luck with the diagnosis!
Best regards
Jaideep