The error usually comes from having this document associated with one of your Onboarding Templates. The template will need to be updated to be able to delete it.
Follow those steps to fix it:
Select your Staff module
Go to Onboarding Templates
Select Edit
Find the document either in the Employee Tasks list or under Resources
Delete
This will allow you to delete the document you previously had issues with.