When you use "declare record" in a SharePoint Online library it makes the library un-deletable.
Even if you undeclare all records and remove all the files the "remove library" setting will be unavailable from the document library settings page in the UI.
Luckily this is easily remidied with some PnP PowerShell
Connect-PnPOnline https://<tenant>.sharepoint.com -Credentials <credentials> $list = Get-PnPList -Identity "<Offending Library>" $list.AllowDeletion = $true $list.Update() Remove-PnPList $list -Force
Subscribe to Cognit Dev Blog
Get the latest posts delivered right to your inbox