It seems that the management package you want to delete is missing the reference management package used. There are related Monitors, rules, discovery in your XML file. Try to search for relevant overrides in the SCOM console and remove them.
How to remove/modify SCOM management pack
When I want to delete an MP1, it prompts me that there are related MP2s that need to be deleted first. So I found the related management pack MP2.
At this time, I must delete the associated MP reference "MP1" from the related management package MP2. So I need to export and modify the xml management pack file MP2.
When I deleted the MP reference from the related management pack MP2, and then imported MP, I encountered the following error:
"If any management packs in the Import list are dependent on this management pack. the installation of the dependent management packs will fail.
The requested management pack was invalid. See inner exception for details. Parameter name: managementPack”