After advice on this site and others, I have identified the issue as a faulty port valve (there are 2).
When both valves are switched to manual and the heating is turned on, I get hot water too. However, as there are two, I'm not sure which one is causing the problem.
When the heating is...