"nil socket, 146 Connection refused" after long duration

I'm getting a "nil socket, 146 Connection refused" error, but it seems to happen after ~24 hours of continual use. I have a sketch that is accessing the bridge for parsed python data and everything works great for hours and hours, then everything stops and I get that error using the arduino.local/data/get command from a browser.

The data is updated every 10 minutes, so it works fine well over 100 times before it gets this error and then the board needs to be reset. I have a very similar sketch running on another project and it has run for months without trouble. Could a faulty board cause this? There's not a lot of information about this error message, so I'm hoping someone else can help. Thanks!

Edit: I should also add that the Serial Monitor works fine and returns my data, and then only says "unable to connect: is the sketch using the bridge?" once the error occurs.