I am in a 3 story apartment building with roughly 20 units. Periodically while taking a shower the water will suddenly lose heat and become ice cold. I chalked this up to lack of hot water coming from the main water heater, but today I tried flipping the diverter back down during one of these spells so that water came out of the tub faucet. Much to my surprise, this water was scaling hot. I could flip the diverter several times and the effect was robust: scalding water out of the tub faucet, icy water out of the showerhead. After a minute or two the spell ended, and it went back to normal water from both fixtures.
What could be causing this? Note that there wasn't any water leaking from the showerhead while the tub faucet was on, or vice versa.
EDIT: My landlord stopped by and checked out the diverter. It didn't haven't any visible problems, but he replaced it to see if that would help. It did, and now the shower seems to work without any issue. I still don't really know what the problem was, but hopefully this info will be useful to someone else.