I did completely restructure my code and removed the interrupt routine. I found that simply polling the sensor input in the main loop was accurate enough for my purposes. The device has been sitting in my roof for the last 18 months and working well.
I have been thinking of updating the code to use MQTT and when I do that I will try the interrupt routine again.