I know exactly what you're going through.
Every time my dad went to the hospital he came out worse than he was. It's just not a good environment for older people who are fighting behavioral changes caused by old age or dementia. He was abusive to the staff, which was totally out of character for him. He was freightened and paranoid. Tried to leave the hospital a few times....
They would drug him up and that would make him delirious but didn't really calm him down.
It was horrible to watch, I had to put a stop to that and just be at the hospital 24/7 and calm him down when he started getting agitated. As soon as he was out of the hospital he started doing better but every hospital visit was like 2 steps forward 3 steps back.
I promised him I'd never put him in a home, that's what he was most scared of. He saw his sister go downhill in one of those places and how horrible that environment was.
Getting old sucks but having family and friend support makes an amazing difference to their quality of life.
It takes a lot of sacrifice and patience but you can only hope that karma will do its thing and that somebody will be there for you when your time comes.
Cowabunga.