This sensor won’t test like that. Running continuity through a transistor that requires a magnetic force to pull down the circuit to make a square wave won’t work without a 5V source. It is true that heat can cause the transistor to fail. It’s quite common, but the test method is a no-go. You probably tested a permanent magnet Hall effect type sensor that makes its own voltage.When we had a crank sensor problem at Mercedes in the early 2000s this worked like a champ until we figured out the bad part #s that were affected. And no, these rarely set a code.
When the sensor gets hot and expands, the circuit goes open. When it cools off, the circuit makes contact again.
This is more common with inductive sensors, but heat can reproduce a failure mode in other types as well.