My sense is the lawyer's advice was a reasonable judgment call and probably the prudent course of action. Any application to IRCC can trigger a Residency Obligation examination.
I'd estimate odds of the child being issued an extension of visitor status to remain in Canada with parent who is inadmissible due to a breach of the RO, with intent for child to STAY in Canada rather than visit, were NOT good.
I do not know what the odds were that an application for an extension would trigger a RO examination of the parent, but given the consequences I'd definitely side with the lawyer's advice and NOT take that chance.
REMINDER: Section 41(b) states that a "person is inadmissible . . . in the case of a permanent resident, through failing to comply [with the Residency Obligation]." Any transaction with CBSA or IRCC involves a RISK that an official will take note of the individual's inadmissibility and pursue the procedures to adjudicate it.
This is one of those provisions governing a failure to comply with the IRPA (Immigration and Refugee Protection Act) . . . it is NOT illegal to fail to comply with such provisions in the Act in the sense there are no punitive provisions for doing so. There are potential consequences, which are mostly tied to procedures to enforce the Act (like pursue proceedings to officially adjudicate a PR's inadmissibility) BUT, for example, unless IRCC takes action and reports the PR for inadmissibility due to a breach of the RO, time the PR spends in Canada counts toward compliance and the failure to comply is totally cured once the PR has physically been present in Canada 730 days within the preceding five years.
Similarly I have NO idea why anyone here would claim a child in Canada without status is "illegal," again at least not in the sense that there is any prescribed punishment . . . to be clear, there is NOT. This is NOT the U.S. The only negative or punitive effect is possible Removal proceedings; that is, the only effect is that CBSA or IRCC can initiate proceedings to enforce the Act.
Once a parent is in compliance with the PR Residency Obligation, a brief trip to the U.S. (assuming parent still has status to travel to U.S., per U.S. immigration) with the child, will totally cure the fact the child was in Canada without status. Should cause ZERO issues in the application to sponsor child for Canadian PR status.
The fact the child is without status does cause some difficulties. Medical care in the event of an emergency looms large in my mind.
TAX BENEFITS:
Some tax questions are easier to answer than others.
The lawyer may have been able to offer advice about this. A reputable tax accountant should be able to address the question.
Generally there is no cause to worry that information reported in a tax return will be sent to CBSA or IRCC, and it appears there is no reason why CBSA or IRCC should be engaged in an investigation let alone one in which they would request CRA information about you or your family. (Ultimately, of course, where a government body has reason to conduct an investigation, the scope of that investigation can sometimes reach, where justified by particular grounds, otherwise private information held by other government bodies; thus, beyond the general and moral imperative to be honest in all dealings with the government, it is also prudent to be truthful AND consistent because one hand in government can, sometimes, reach for what is the hands of another part of the government.)
BUT that might not be the issue. I can only guess what other issues there might be. Is the child's residence with status a required element to qualify for the benefit? Again, the lawyer may have been able to offer advice about this. A reputable tax accountant should be able to answer the question. If this is the right question.
My sense is that what matters is what information CRA asks for. If CRA asks questions about or dependent on the child's immigration status in Canada, in order to qualify for the benefit, that's a clue, a big clue. If not, that too is a clue.
In any event, just like information provided to CBSA or IRCC, the best approach in filing tax returns is to be truthful and NOT conceal information.