Just to demonstrate your point about a clubs obligations, I know this was a while ago but Robbie Fowler was still being paid by Leeds even when he was at Man City - https://www.standard.co.uk/sport/money-pit-that-is-leeds-united-7228789.html#:~:text=The Leeds chairman also revealed,them £800%2C000 in total.
If his contract is worth £6m a year then Leicester are obliged to pay that whether they play him or not - if they don't plan to play him and Wednesday can cover £2m of that then Leicester have saved £2m.
There's other factors like the possibility he might trigger another year by playing X amount of games for them, which they'd want to avoid too.