This happened to me, except everything got taken care of before I signed P&S.
Your lawyer should have put a clause in your P&S stating that the seller will deliver a title free of any missing or open permits.
In that case, the sellers should fix it. This was my scenario.
If that clause does not exist in your P&S, then the sellers aren't responsible. You could either back out or just deal with it.
Dealing with it would involve getting a city inspector to come verify that everything is up to code. If something isn't up to code, they'd make you rip it out.
Worst case scenario, you'd be paying for a new bathroom. Not the end of the world but not super cheap either.