The fact remains that a company exists to make money. When a company mandates RTO, generally it's doing so because it believes that's the best way to get the maximum output of it's resources against whatever metrics they are measuring against.
Employees should feel like the relationship between them and their employer is mutually beneficial, if that's no longer the case, pursue external opportunities.
We are incredibly lucky we are in a field that has a high demand for strong engineers, so you should be able to find what you are looking for.