Thats step 1 of 2. The 2nd part involves forcing the role of SCRUM Master on either the leader of the team, the least lucky person who draws the short straw or finally the lowest producer on the team. Now - you still got SCRUM Masters, you're just not paying for them. Ive seen this done in real life, believe me, it works about as well as you think it would.
TL;DR - The company fired PAID SCRUM Masters - however it didn't necessarily do away with Agile/SCRUM so much as it simply forced the defacto role of SCRUM Master on someone already being paid as a developer and when you give a person with one full time job an additional full time job neither of those jobs get done well and wheels start falling off in all manner of places.
Sorry if I wasn't clear but I've seen this happen at a company I worked at. Cost Cutting became a thing and our division was asked to "contribute to the cost cutting" and our only real option was to reduce headcount. The production demands on our team were such that cutting a developer already highly experienced in our domain wasn't deemed smart (they were too hard to hire in the first place).
The solution arrived at was the the developers themselves were familiar with SCRUM enough that perhaps full time SCRUM master roles were not strictly necessary. The devs were accustomed to the process enough that hands-off, far above management types reasoned devs could just go on as usual in the absence of a dedicated SCRUM Master.
Fast forward a few months, it's not going well. Sprint planning is out the window. Predictability is in the proverbial toilet. Code reviews are getting rubber stamped. Tickets with properly planned subtasks? F-that, we're just going to start coding! Defects you ask? Yeah, there were a lot more of those too. Missed sprint commitments were the new norm.
To asses their wild success in saving so much money the far above, hands-off managers all had a meeting and looked at sprint metrics and damn were they skewed. Some teams that were averaging 1.6 points per dev before were now averaging 6 (story point estimation went out the window with the SCRUM masters), Velocity was now insane since story points were now just a manipulated number (a 3 point normal story was now an 8 and a lazy dev got to park his or her ass on one ticket for a 2 week sprint). I could do this for an hour and still not fully express how badly things turned out.