First off what you posted is a totally different scenario to yours. You are asking if your spouse can be a self-employed contractor from the US for a Canadian employer if you are a Canadian citizen or PR. Big difference being employed directly by the Canadian company or working as a contractor from the US. When a lawyer advising you not to mention that you are working while in the US there is a reason. You are a guest in the US on a visa that technically does not allow a spouse to work. The increased amount of remote work as an employee and not as a contractor has created some potential loopholes or grey areas. If CBSA discovers you were working while living in the US they would likely not be pleased. If you live in a cross border community crossing the border into a Canada everyday to work may be an option but CBSA may also get mad that you are working in Canada while living in the US. The US is very strict when it comes to what is permitted and what they feel is acceptable compared to Canada. They often feel it is one of the other.
In terms of tax implications I’m not sure how you would get around the fact that you would have to declare on your US taxes that you are working without the authority to work. Working for a Canadian business as a Canadian employee may make you both tax residents. CRA would have to determine that. Would suggest speaking to a US immigration lawyer and an accountant that specializes in cross border taxes.