warm water only when we replaced the hot water heater with a tankless heater
It could be a thermostatic shower faucet, where the backflow preventer is defect. Or a backflow preventer is defect/removed at any other place. That way the cold water is getting into the warm pipes/hoses, sometimes even if the shower faucet is closed. Normally the warm side has lower (dynamic) pressure, sometimes tankless heaters have a throughput reduction. 
Backflow preventers can be easily missed since they are available as small coin sized inlets for water valves.