"Doesn't engage the flywheel"
You mean, you turn the key, and the starter winds up and sounds like a siren? Other times it cranks normally?
Failed starter drive. It IS engaging the flywheel, (because the motor doesn't get power until the solenoid pushes the starter drive into position) but the one-way clutch in the starter drive is slipping, so the motor spins without cranking the engine.
Common as dirt. New starter drives are available, but most folks just replace the starter. By the time you remove the starter, tear it apart, replace the drive, replace the shift fork, replace the bushings and brushes...you might as well just buy a replacement starter that has a warranty.
Heat-related problems generally involve the starter motor turning slowly, or not at all. If it spins up like it's being bench-tested...it's the drive.