The failure of the AHCA was basically two fold:
1. Tax credits don't do shit. No one understands how that really works and if you don't have much in the way of taxes, it really doesn't help. Plus you could end up owing taxes in April to cover the difference.
2. It didn't go far enough. The AHCA tried to be a middle ground, keeping some items that were popular, such as not excluding pre-existing conditions. But there was a group of hardliners who feel that everything (including that) should be removed and everything should be rolled back to 2008 laws. A total, 100% repeal.
So really it's just a division of poor Republicans vs uncompromising Republicans.