Random Z-Axis Homing Failures

Actually, I ran into something similar and it turned out to be a bed leveling problem due to the bearings popping out. There is a thread on it here as well as a Bambu Wiki.

Did you by chance get any of these error codes on your screen:

Here are two intertwined threads on this topic with possible remedies.