While the device is 3 years old that doesn't seem old enough for the haptic motor to have failed which brings up some other questions.
Has the phone taken a fall? It may not have even been near the time this started but any that you can recall before it started. If it has taken a fall more recently does that fall correspond at all with its return?
Curious if you took it out right now and tried it by typing something what would happen if you tapped it in your hand, like a solid thump against your palm? If it was working does this cause it to stop? Or if it was not working does this bring it back to life? (I'm picturing you holding it on its edge and striking your palm like a karate chop, and maybe trying from each angle once and testing in between.) This seems like the most possible thing to me since it died then came back then died again. It's like there's something in there not letting it spin.
Has the device experienced any wetness, even if it didn't appear to interrupt the function of the device?
Moisture is something that can be gradual or abrupt. Usually if it is abrupt you know what happened, when and why. Often if it gradual you may not experience anything for hours or days. That little bit of water creeping its way slowly into that one thing you finally notice.
I still think there's something in there vs water but hey you tell us.