I have seen this error occur on WordPress due to a false positive generated in WordFence security plugin.
If that might be your issue, put WordFence Firewall back into "Learning Mode", try saving/testing a Mosaico template email again in Civi and - if that is the problem - then WordFence should Whitelist the action, and the error should disappear.
I have had similar issues recently, after I have manually ran some random scheduled jobs forcefully.
Later I have changed the time of the scheduled job, specially for the ones that runs daily, to the default (12:00).
Since then my issue resolved. I would suggest try that.