Hot water turning cold in pipe at branch line
Failing back flow preventers in a shower or kitchen thermostat faucet could be the reason. At that faucet, the cold water could be pushed into the hot water pipes, since the cold water normally has a slightly higher pressure.
The back flow preventers are upstream of the mixing area which is upstream of the opening valve, i.e. this effect is significant even if the faucet is not in use. In a normal non - thermostat faucet, the mixing area is downstream of the opening valves.
The hot water back flow preventer is usually the first to fail due to higher temperature.