Sounds like the biggest mistake he made was lashing out at a likely in-over-their-head manager. We are only getting one side, but sounds like he was trying to do the right things to either overcome the challenges and/or create boundaries, but he may have been hired to be a sacrificial lamb. In my consulting times, I was brought into something a lot like this for the purpose of being fired so that the CTO could save their job. It can be very challenging to get a read on an employer / client who is intent on misleading you. It can also sometimes be a manager who needs to save their own job who may not be deliberately lying so much as simply in a fight / flight situation themselves.