I had a problem and found the cause, so I thought it would be helpful to share it here in case someone else runs into the same issue one day.
I'm using the Helix3 template (mainly because I find the admin interface very comfortable). Yesterday, I noticed that I could no longer save any template styles—both site and administrator templates. I searched a lot on the web, but nothing helped (cache, WAF, PHP settings, privileges, etc.).
AI suggested it could also be a conflict with the JoomShaper Helix Framework — which turned out to be a good hint later.
I hadn’t noticed this earlier, so I’m not sure when it stopped working, BUT:
I can’t explain how (I suppose I installed it by mistake in the past and updated it to 2.2.2 before updating Joomla from 5.3 to 5.4.1), but I saw in debugging that when saving template styles, the Helix Ultimate Framework was being called.
Since I'm using the Helix3 Framework, it didn’t make sense to have the Helix Ultimate Framework active. So I deactivated the Helix Ultimate Framework — and tada… saving templates works again!