There are always a lot of cases like this. People go into hospital, their care needs substantially change, their home environment is no longer suitable for them, but they have no money to privately fund a suitable environment so they have to just wait. And wait.
There was a woman 3 years in my local hospital, medically discharged. She had very very complex physical needs and couldn't go back home. It was awful. She ended up bring several court cases against the council in order to light a fire under them.
There is another lady currently in my local hospital. Very elderly. Has been medically discharged for the past 2 years. Is a ward of court and is literally waiting that long for her court date. She has dementia and is on a 14 bed ward. She is quite content as she has no idea how long she has been there. The staff are phenomenal to her. Her obs are only done once a week though as she's not unwell.
It's so awful but I suspect happens everywhere.