After a few days of cursing and tweaking of settings, we seem to have reliable hot water. Theories had included blown fuses, broken elements, and fickle thermostats. In the end, it seems the tank had been overheating and cutting out, mostly at night.
We’ve turned down the temperature, and the tank seems to be happier. A few more days will tell. We’ll also soon see if moving to a smaller tank at a lower temperature still provides enough hot water for both of us to shower in the morning.