Mary is also, by the standards of the day, constantly putting herself forward in a way which was interpreted as a moral failing.
There's a reason we have so many scenes of Austen heroines and other respectable ladies demurring when first asked to play on the piano until the host/hostess insists some more. It isn't modesty, it's morality, and it's why Mary not waiting to be asked to play and not being aware of when she's performed an excessive amount is judged so harshly.
I don't personally agree with a lot of regency lady behavioural standards, but to contemporary readers Mary is attention seeking and vain, not demonstrating any modesty or that demure behaviour which spoke of a woman having good principles. In that way she's way more like Kitty and Lydia then modern audiences can easily see, though their exhibiting takes very different avenues. But it was still an indicator of improper principles.
It's why she's included in the 'that total want of propriety so frequently, so almost uniformly betrayed by [your mother], by your three younger sisters, and occasionally even by your father' (ch35) line that Darcy writes to Elizabeth. She isn't just awkward, unlikeable, or not well rounded - she was often completely lacking propriety. Elizabeth names this judgement on her family a 'mortifying, yet merited reproach ... The justice of the charge struck her too forcibly for denial' (ch36). She doesn't make an excuse for Mary, but includes her equally in the condemnation against the behaviour of Mrs Bennet, Kitty, and Lydia.
Here's the definition of the word propriety, as I believe Austen used it in this context, from the Oxford English Dictionary: 'Conformity to accepted standards of behaviour or morals, esp. with regard to good manners or polite usage; seemliness, decorousness, decency; (observance of) convention.' That is what contemporary audiences, and the sensible characters within Pride and Prejudice itself, thought Mary was lacking. She has a problem with morals, good manners, and decorum. Not awkwardness or being unlikeable, nor shyness or trouble socialising (and in fact, I'd argue that Mary's behaviour is the opposite of shy). Though she's such a minor character it isn't as important a change, many modern interpretations of Mary are very similar to the 'Darcy isn't a snob, he's just socially awkward!' thinking which ignores the book canon.
I'm also a proponent of the idea that, where Kitty and Lydia demonstrate the flaws of seeking experiences and no reflection, Mary demonstrates the flaws of seeking only reflections and disdaining a lot of real world experiences. A situation rectified somewhat at the ending of the book, as with her sisters gone, 'Mary was obliged to mix more with the world, but she could still moralize over every morning visit' (ch61). Hopefully this situation also made her more self-aware, and less inclined to put herself forward indelicately when she didn't feel the need to compete for recognition.
It's so understandable that modern readers project social awkwardness and shy bookish-ness onto Mary, because social standards of behaviour have altered so much in 200+ years and she's a minor character, but Austen did actually write her as confident and forward to the point of vanity and disregarding morals. I have yet to see any novel that focuses on Mary recognise that, and work within that framework for her character arc. And, because it's missed, so too is the nuance of why she's disparaged by the narrator and not praised or particularly liked by Elizabeth and Jane.
This has a flow-on effect of authors needing to find some justification for why Mary is so overlooked, which, since they don't recognise Mary's own flaws, generally means they need to invent or exaggerate flaws in other characters. Which is why you get characters suddenly focusing on likeability, or looks, or social prowess, to a degree that they never did in canon, if at all. I enjoy reimaginings, but you have to be really careful and knowledgeable when making beloved characters shallower or meaner in a way they weren't in canon in order to white-wash a minor character for it to work well, and I'm not convinced they've done that in this instance.
I know I've been very harsh on Mary's character here, so I should add the disclaimer that I actually adore Mary, as I do Kitty and Lydia (yes, even Lydia). They're teenagers whose education (and emotional well being, in the case of at least Mary and Kitty) has been neglected and thrown out into society at a young age to figure it out for themselves, so I'm not at all surprised they've misstepped and gone too far in seeking external validation. Mary sure as hell didn't get enough of it growing up. But Mary isn't judged by the world because she doesn't fit the pretty, sociable, likeable mold her other sisters do, she's judged because of her own actions and the values that demonstrates to respectable society.
I just wish that more works focusing on the younger Bennet sisters recognised the actual (contemporary) errors of their behaviour in a sympathetic way and worked to show how they might improve as they grow, rather than excusing all or most of it and saying that it's everyone else who is acting wrong.