I've deposited cash in friend's checking when they were low & they paid me back the same way. Of course they have to trust you to give you their checking acct #.
Most banks at least in the US won’t let someone besides the account holder deposit cash anymore
I'm in the US and have done this very recently. Not huge amounts, but no problem. Didn't even need an ID. Have you tried to do it? How do you know they will not?
Many years ago I'd just moved to area & wanted to cash a paycheck from a Chase acct. Even w/ ID they refused. I said it says "Pay to the order of" they said that's not what that means.