If he says what he said here, the interviewer will likely think: This was either a person who was impossible to work with because they always think they are right or the company was actually bad. I can't know what is true so I'm going to take someone else.
In Australia I have always respectfully told the truth. It is no secret some companies have terrible management and IMO It can come across well to the type of employers you might want to work for. In this situation I might say something like - "Well I had some great ideas on ways that we might improve our technology stack but unfortunately the manager there seemed threatened by my ideas and shot them down without further discussion. In the end this friction seems to have lead to them deciding to let me go. I learnt a lot from my time there and look forward thriving in a more constructive environment!"
The "truth" isn't what's important, your attitude and reaction to the layoff is what people are looking at. How you handle yourself is what's important.
Because everything must be positive, for the short amount of time you are interviewed. B company doesn't have empathy for the nuanced reasons why you left A company, the criteria the interviewer has doesn't account for any of it.