New chains are almost always too long and need shortening to the desired length. There's no doubt that it's far too long, there shouldn't be any slack even on the small-small combination - well no, you shouldn't use it, but shifting mistakes happen and you don't want the chain to go all limp in such a case - but now it's not good even on the big ring.
Before ordering a new one, even though $50 isn't much, I would have checked if the old derailleur would actually have worked although it's said that it doesn't. The medium cage XT derailleur, for example, doesn't officially work with the 10-51 cassette but in reality it does. There's always a ton of safety margin in the compatibility claims so that people don't get it wrong, break stuff and then complain that it was said to work.
The only downside in a longer cage is more chain movement on rough surfaces but unless you're doing the Aremberg forest at race speeds daily you won't notice a thing. Oh, and when you install it (if you do it yourself, otherwise ask the one doing it) put in a new cable too. Cheap and easy to do when the derailleur is off anyway. And don't leave the barrel adjuster that much opened, cables will stretch, housings may compress, and that one is close to the outer limits already.