Another case where EU has this settled. If an airline cancels a flight, they are obligated to refund the money in the same payment method, or book another flight, depending what the passenger chooses. They have to provide accommodation in a hotel if needed & you can request compensation up to 600 euros if the cancellation/delay was done in short notice.
The EU isn't quite there yet, see the issues with refund processing times during covid for an example. I heard some official talking about how airlines shouldn't be allowed to charge you until you step on the plane, which sounds like a brilliant solution to me. Don't have to fight the airline for compensation for a flight that was cancelled if the airline doesn't have your money yet.
This sounds insane until you realize that this is essentially how hotels work. You pay a deposit, and the rest isn't owed until you are physically in the hotel.