Hey,
just noticed I have same issue.. Hosted on Cloudways though. When i try to edit functions.php file it will clear it out and give the error.. I have no extra functions either.. Was trying to add my first one.. 🤷♂️
I can though however just upload the file sftp.. Dont know 😉