Locks up or becomes unstable after a few hours

I can’t say definitively what is going on. When it restarts it is timing out doing a query, which could be the Graph+ that you say you leave running, or possibly Home Assistant if you are using that.

If I had to guess, and I suppose I do, I would suspect the SDcard is bad. Replacing it would be the next diagnostic step.