This is occurring as credit card companies reverse transactions for flights that have been cancelled. In response, airlines are sending the travel agents involved agency debit memos (ADM) requiring them to pay the transaction amount back to the airline.
Whether this is legal or right depends on whose credit card was used to make the booking, i.e. who the contract is between. If the booking was made on the consumer’s credit card, then the airline should not be issuing an ADM against the travel agent.