I’ve seen machines that still hold the card so it can’t be removed (even though it remains visible), and will only release the card before completing whatever transaction you’ve asked it to do. Like, you have to take the card before it’ll tell you your balance or give you cash or whatever. This is 100% a “we’re not taking responsibility for you leaving your card in the machine” thing.
That card lock isn’t to keep someone else from stealing your card, it’s to make you take it. As long as the machine will only do what you’ve asked after you take your card, the bank isn’t responsible for your card at all.