Not exactly on point, but the Ontario Superior Court has ordered the release of a man held in detention in prison for seven years while officials tried to figure out a way to deport him (based on his criminal record). The court ruled that the length of detention violated the man's Charter rights (no indication, afaik, of how long a person illegally in Canada can be detained without it constituting a Charter violation, just the ruling that seven years is not reasonable).
The case is interesting, the man entered Canada from the USA on a fake passport in 1986. Based on his story, he would be Ghanaian and/or Nigerian, but neither of those countries accepts that he is their national as his birth was never registered. So in this case the man seems effectively stateless and in limbo in Canada with no legal status. He is living with his 26 year old daughter, who I presume is Canadian by birth.
https://www.thestar.com/news/canada/...alks-free.html