The House leader must be someone absolutely capable of counting votes. Ryan did not have the votes to begin with to pass his version of health care, and his whips could not change the situation.
In effect, Trump should know by now that the people who cheer for him the loudest are followers in name or spirit of the Freedom Caucus. He must understand by now that there are members of the House of Representatives (albeit a small percentage) who have the courage of their convictions. And, if I read the man correctly, I do not think he will ever again underestimate their willingness to replicate Horatio at the Bridge when they feel so compelled to do so.
Link in comments to Big Club is a good read...
https://theconservativetreehouse.com/2017/02/24/to-remove-obamacare-we-must-first-remove-the-uniparty-big-club/
...Trump understands and is fighting it.