Need some painting advice
You are right- you can't just paint over it.
There's a reason that the other paint didn't adhere- is the mud ( i assume) that's left real powdery?
I would stabilize the wall with a thin penetrating primer called Gardz- do a search here on it for some application tips-
It will glue everything down-
Then the wall needs to be skimmed with joint compound- might take 2 to fill enough- then sand smooth- then reprime, then paint 2 coats.
All these steps are searchable- but it might not be a bad idea to get a pro to do it- it isn't easy if you haven't done it before.
"It's better to come here with questions before you screw up than to come here after and ask how to fix them."- JS