That is an error designed to shield against the unsafe situation of two Macs trying to access a network-hosted library. In your case, it seems spurious. I've seen that reported a few times over the years. The cause is unknown, but theories include Dropbox, Google Drive, another Mac on your network, or other auto-backup apps grabbing the library while using your own credentials, or locating the FCP library on an NFS network share.
There is code in FCP to automatically fix this situation of "orphaned" lock files, but for some reason it doesn't handle these few rare cases. The first step is just to reboot the machine. If that doesn't work, reset FCP settings: Change settings in Final Cut Pro for Mac - Apple Support
If that doesn't work, I suggest duplicating the library using Finder as a precaution, then opening the original library in Finder by doing right-click > Show Package Contents. Then enable hidden files via SHIFT+CMD+period. There are hidden files/folders named .lock, .lock-dir, and .lock-info. You should be able to delete those without any harm.
If that doesn't work, post your results after trying the above steps.