by Howard Miller.
Both database sessions and moodledata sessions have serious performance issues. I would *strongly* recommend that you invest in a Redis server.
Your problem does sound like a cache error. I have a nagging feeling that I've seen it before. My next step would be to change/improve caching to see what happens. I'm sorry that I can't be more specific.