If her permit expired she has "lack of status" which means she doesn't have a valid permit or visa. However, she can still be granted PR. She is technically not allowed to stay, but there is a public policy which basically says that it is in the public interest to assess all foreign nationals regardless of status. This means that even though your wife has lack of status, her PR can still be processed AS LONG AS you guys meet all other requirements in your application (including that your wife has a valid passport).
HOWEVER, this comes with some limitations including forfeiting the right to appeal should the application be refused, longer processing times than an oversea application, and the requirement that your wife stay Canada until the application is finalized (she cannot travel).
Still, the fact that your wife can still be processed for and granted PR does not mean that she has a valid status. Temporary resident permit (student, work, visit) is a separate thing.
At this point you have 3 paths, I think.
1. Your wife stays>keep processing your PR application>make sure you meet all other requirements>your wife stays put in Canada and can't work or study>If all else is complete and approved, your wife gets the PR
2. You do what the lawyer said>remove your application>your wife leaves the country>your wife applies overseas>you will be separated during this time>she comes back to Canada.
3. You remove your application> your wife leaves the country>your wife gets a new proper temporary resident permit (visit, work, study) (this is because more than 90 days passed)>your wife comes back in>you guys apply inland again. (This one might be a bit more complicated depending on your wife's country)
I recommend you read this policy, I found it very useful.
https://www.canada.ca/en/immigration-refugees-citizenship/corporate/mandate/policies-operational-instructions-agreements/immigration-refugee-protection-act-spousal-policy.html?wbdisable=true#8
https://www.canada.ca/content/dam/ircc/migration/ircc/english/resources/manuals/ip/ip08-eng.pdf (same info, complete document)
About your wife's permit:
2. Temporary Resident Permits
What happens when a person falls out of status and the ninety days have elapsed? At this point, it is advisable for the individual to exit Canada. That said, as a last resort the law allows for the submission of an application for a Temporary Resident Permit if compelling reasons why they should be allowed to remain in Canada can be established and the risk to Canadians is minimal, among other factors.
Discuss your options with your wife, the pros and cons. I hope you find a solution and I wish you the best.