Current engineer at Amazon. Maybe a particular bad manager is doing this, but there's no institutional mechanism where management or executives literally count people's commits.
Worst case, you're on a team who's late on deadlines and you have 0 commits in the past several months. Yeah, there are going to be questions about where people's time is being spent and are those the right priorities. Aside from that, people aren't comparing commit counts to stack employees. The simplest reason is – it's much more expensive to let go someone and re-hire and train another engineer. You won't hear about that on any of these news stories because it's not so attention grabbing or interesting.
Amazon for sure can do better in many areas. No denying that.
But keep in mind we have a massive workforce of engineers. If 1% of them are unhappy, and even 5% of those unhappy people are willing to post about it on Reddit, Hacker News, Leetcode, or where ever, you're going to feel like every person at Amazon basically hates their job.
And the other thing is the people who do respond with positive experiences don't get the "upvotes" and get their experiences pushed to the top of the discussion. They often get down ranked and personally attacked.
Lastly – No one is counting lines of code. This is actually a pretty absurd claim, and I can't say it's NEVER happened, but anyone doing that is a wrong hire. Less code is generally better. There are no brownie points for more code or more complexity. Amazon's leadership principals encourage frugality and invent and simplify.