OME, I have been having this exact same problem in the Y axis with mine lately, I have tried and failed many times to get the large extruder gear printed at 30% hexagonal infill and it fails as you have shown in the last 20 minutes of the print. So frustrating since its about a 2.5 hour print.

I tried putting a fan near the RAMPS stepper driver heatsinks to see if cooling them down helped. This seemed to allow the print to only fail at 10 mins before being complete. (progress?) I do not have any active cooling on any of the stepper motors themselves.

I also noticed that after the print failed while printing, I was able to pull the bed and cause the belt to slip over the teeth on the Y stepper gear and by doing this, the print error was even worse. Point being, I think the belt is heating up and becoming less rigid and allowing a little more flexibility in the belt.

I've had this issue before with the set screw on the y pulley coming loose and causing this issue but I think this time it was because my y belt was just tight and now super tight. I've tightened it as much as I could and will try this print out again to see where we are.