Do you leave tabs open in your browser for extended periods of time?
Any WordPress page which takes input contains within it, a “nonce”. This is a special code which helps protect against a lot of things.
That code changes every 12 hours. After 24 hours, the code on the page becomes completely invalid and won’t be accepted anymore.
So, if you left the theme editor screen open for a day, then made your changes, and then tried to save them, you’d get the nonce_failure.
Fixing that would just be a matter of loading the editor page fresh and new, and not leaving it sitting around for the day.
On the other hand, if that is not the case, then some other things could possibly cause the problem as well. But best to check the obvious one first.