It sounds like the mixer valve is faulty. Generally there's a some form of thermostat that tries to keep the flow at a set termperature. It used to be done with bimetallic strip technology but nowadays its probably done electronically with a temperature sensor in the output flow and electrically operated valves to feed appropriate amounts of hot and cold water.
Thinking about your symptoms, I'd say the hot water valve is sticking closed. The scalding water comes out when it occassionally opens but then the system compensates, closing the hot water off and ramping up the cold. Because the valve is sticking, it then fails to open again to balance the flow.
Of course, it could be a single switching valve, in which case the explanation is the same as above but the cause is the valve sticking in the 'cold' position.
This is why I stick to baths :-)))