Apologies for not replying anymore to this thread.
This error still persists in LiteSpeed Cache v2.9.9.2. However I have identified a workaround that allows me to update to the current version of LiteSpeed Cache: Install the “Better WordPress Minify” Plugin. (This plugin still seems to work in WordPress 5.x despite being outdated; it is available for download at http://betterwp.net/)
If “Better WordPress Minify” is installed, LiteSpeed Cache will recognize it and use it instead of its own internal JS Minify function, so the issue disappears.
For some reason, installing “Fast Velocity Minify” does NOT resolve the issue on my site.
I have also looked into the issue a bit further and it seems like it’s related to the escaping of special characters. In the source code pastebin above, on line 41, there is one occurrence of ' which is the HTML character code for a single quotation mark (‘). This is where the error lies, as the source code would be correct if that quotation mark was left in place, rather than being escaped.
I’m still looking for a simple way to reproduce the error on a clean WP installation.