You swapped X and Z? Isn’t the voltage setting for X almost twice that of Z because of the parallel setup of X and Y. That is probably why X wouldn’t move and Z did after the swap. Do you have an IR heat gauge that you can point at the Z when it stops working to make sure it didn’t overheat? Also a fan on the ramps is always a good idea if you don’t already have one to keep the stepper drivers cool. Another thing to swap is maybe one of the other stepper motors and see if maybe the one you have on Z is failing.