The idiomatic expression "to open a can of worms" means to try to solve a problem, only to create more problems out of it or to get into a lot of trouble as a consequence of trying to fix this problem in the first place.
From How Did the Term "Open a Can of Worms" Originate?
Metaphorically speaking, to open a can of worms is to examine or attempt to solve some problem, only to inadvertently complicate it and create even more trouble. Literally speaking, opening a can of worms, as most fishermen can attest, can also mean more trouble than you bargained for.
And in wiktionary
(idiomatic) A complex, troublesome situation arising when a decision or action produces considerable subsequent problems.
- If someone gets a promotion that might not be deserved, it could open up a whole can of worms with the other employees.
(idiomatic) A troublesome situation; an issue whose resolution is difficult or contentious but not necessarily complex.
- Questioning the decision would definitely open a can of worms.
Is there a equivalent in Spanish for this idiom apart from referring to Pandora's box? Something that means "to create a complicated situation in which doing something to correct a problem leads to many more problems".