Do you really think Trump was stupid enough to believe that a "replace" bill was ever going to pass?

No one believed that the establishment republicans would repeal, or even replace, a law that ultimately gives them more power over the people. Forcing a bill now was a demonstration by the executive office to further claim that everyone in Washington--save Trump--is duplicitious, thus adding to the "swamp" narrative.

Joel Pollak's analysis on this debacle was solid: it was an elaborately designed ploy to humiliate Ryan and friends and put them in a weakened position. The people already hate them and love Trump--primarily because they're already aware that the establishment was against him from the get go. As such, Trump can only benefit from republican failures.