Failed library scans with a Database Locked error in the log are a known Jellyfin problem. The docs have a ladder of fixes, and the first rung is not the database file.
First, lower the parallel library scan task limit in the admin dashboard. The docs say that if it is set to 0, you should set it to half your cores. If that does not help, change the locking mode. Stop the server, open database.xml in the configuration directory, and edit the LockingBehavior value:
<?xml version="1.0" encoding="utf-8"?>
<DatabaseConfigurationOptions>
<DatabaseType>Jellyfin-SQLite</DatabaseType>
<LockingBehavior>Optimistic</LockingBehavior>
</DatabaseConfigurationOptions>
Start the server again afterwards. The docs list three modes. NoLock is the default and works for most people. Optimistic attempts all writes and retries them when they fail. Pessimistic blocks all reads while any write is happening.
The caveat is the last mode. The docs say Pessimistic has a significant performance impact and recommend it only when Optimistic does not help. They also note that on LXC, if the errors stay after switching to Optimistic, the team suggests moving to a virtual machine or Docker.
I’d keep a copy of the whole file before editing it. The example in the docs has namespace attributes on the root element, which I left out above, so keep whatever your own file has and change only that one value.
Further reading: Jellyfin troubleshooting: database locked errors
Going deeper: Guide: the Bazarr settings that matter, from languages to the minimum score