Let's consider a thought experiment.
We have an ICE car at the bottom of a hill. The car has a trailer attached and there is a weight on the trailer. The mass of the trailer and the weight combined is 500 kg.
The car is started, drives to the top of the hill which is an elevation gain of 100 m, drops off the trailer and weight, and drives back down to the bottom of the hill and is shut off.
The trailer and weight has gained 9.8 m/s^2 x 500 kg x 100 m = 490 000 J of gravitational potential energy, which is not heat.
If all of the energy from the car's gasoline became heat where did that 490 000 J of non-heat energy that the car gave the trailer and weight come from?