I have experienced the same thing with my Y axis. If the gantry is too close to my mechanical limit switches when i try to home it (approximately within 150mm), it hits the limit and tries to keep going until i kill it.
I notice that when I pull my y axis back further than 150 or 200mm and start the G28.2 homing command, it goes for about 20mm and then the motor pair makes a blip sound almost as though it’s doing an instantaneous stop start. As long as it does this, it will consistently stop when it hits the limit switch. Odd I know, but I have not tried to figure out there logic there yet.