If it's not working for 10 minutes at a time, it's probably not a heat issue - that takes longer to build up. I take it that replacing the Z axis assembly didn't help with the issues in Z. Have you tried an "air" run, well above the table, with the spindle turned off? Sometimes errors can be traced to RFI from the spindle wires. Have you tried lowering the acceleration values (cutting them in half) for the axes that are faulting? Sometimes the motors loose steps because they're trying to accelerate too hard at the beginning of a move. Do you have current-limiting resistors in place that match the current of your motors? Have you stripped your control computer of extraneous software, like Windows Update, and internet stuff? Often a computer will abandon its job of spitting out pulses when summoned to update something, or to save power when it feels nobody's paying attention.
If you shared some more details about your machine - like the type of motors you're using, the power supply, some pictures of your wiring, the computer you're using, the type of spindle, and the mechanicals, it would be easier to figure out what might be happening.