You could save yourself some effort and not rebuild your library by just telling Kodi where your media moved to…
but if a library clean doesn’t work you can manually remove just the library at the terminal. If you connect via ssh the commands would be…
systemctl stop mediacenter
rm -r ~/.kodi/userdata/{Database,Thumbnails}
systemctl start mediacenter
Note that the commands above are case sensitive.