Locale causes "RenameEpisodes" = −1

Sonarr version (exact version):
Sonarr.main.4.0.17.2952.linux-x64
Mono version (if Sonarr is not running on Windows):
Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-3.2 Wed Jun 30 05:34:49 UTC 2021)

OS:
Ubuntu 22.04.5 LTS
Debug logs:
https://pastebin.ubuntu.com/p/NTZDhQ8yxC/
Description of issue:
I tried upgrading from V3 to V4. I encountered this issue

“UPDATE “NamingConfig” SET “RenameEpisodes” = 1 WHERE “RenameEpisodes” = −1"”

I assumed there was some error in the sonarr.db, but I tried removing sonarr.db and I same the same error message.

I tried to start fresh by rm -rf /var/lib/sonarr, /opt/Sonarr, /etc/systemd/system/sonarr.service and install as root but i get the same issue

Then i changed locale from sv_SE.UTF-8 to LANG=en_US.UTF-8 and this issue went away. Is this expected or a bug?