You cannot fix this in a supported way (through GUI and/or organization service).
My first idea would be to try and remove the solution components from the managed solution first and finally remove the solution itself. There actually is a RemoveSolutionComponentRequest
, but according to the SDK this request is only valid for unmanaged solutions.
If you need to remove particular dependencies, you could try the DisassociateRequest
on the Dependency entity. I don't know if it will work in your scenario, but maybe it is worth to give it a try.
A last resort would be to remove the managed solution, along with its components and dependencies directly from the database. Be very cautious with this approach: it is unsupported and potentially you can end up with a system that does not allow you to import solutions at all.