https://www.reddit.com/r/AskUK/comments/183c74o/what_happens_if_you_are_released_from_prison_and/
I found this Reddit (I know…) forum in which somewhere asked: What Happens if you are released from prison and have nowhere to go? Which is a good question, And I found the answers to be interesting, Now how much of this is true as anyone can lie on the internet, But it could be helpful (With a bucket of salt)

If someone is released from prison, they might get placed in a probation or bail hostel. If they aren't assigned one, their only option is to register at a standard homeless shelter. If the shelter has a waiting list, that person is left sleeping on the streets until a bed opens up.
Users clarify that it completely depends on how you were sectioned under the Mental Health Act:

When leaving prison, some people are placed in probation or bail hostels as part of their rehabilitation. If they don't get a spot there, they have to register at a homeless hostel, and if there is a waiting list, they are left to sleep on the streets.
It gets worse: sometimes the authorities literally just hand a released person a tent and tell them it is their own responsibility to find somewhere to live. * If that person cannot find a place to live, they are told they are in breach of their release licence conditions for not having a fixed address.
Because of that breach, they get recalled to prison to serve the remainder of their sentence. This means a person can be locked up again for years—not for breaking the law, but simply because they didn't have a home. The sick irony, as one user points out, is that getting sent back to prison is the only way these people can guarantee a bed, a roof, and three meals a day.

Set Up to Fail from Day One
The False Economy
The Norway Comparison