We’ve seen such issues happen in the past when servers have trouble handling the processing of HTML entities in the form data.
First test if you are able to re-save the currently saved data, and if yes, look for any entity usage in the new text you’re trying to add/replace.
If saving the (already) saved configuration triggers the same error then the server must have changed/migrated configuration since you’ve initially configured the theme. You can look for the presence of entities in the already saved data, but if that is not the case, it may be server-dependent (related to the hosting server configuration or the additional security layers).