This article walks you through how to force delete the referenced secrets.
Step 1: These two Feature Flags need to be enabled on the Account
To enable this Feature Flag you need to reach out to the Harness Support
Step 2: After that you need to Check
Enable Force Delete of Harness Resources under General Settings as shown in below image:
After this process, you can able to delete the referenced secret without removing the referred entities.