(CNN) The overwhelming defeat of a Republican leadership-backed immigration bill on Wednesday highlighted the unsuccessful lobbying push by President Donald Trump and some members of his administration who actively pushed for the bill's passage -- though not always with the same enthusiasm as Trump's all-capital tweet.

Trump's support for the failed bill had wavered dramatically over the past several weeks -- from the President appearing to criticize it on Fox News to personally pitching the legislation during an in-person meeting on Capitol Hill to his announcement just days later that Republicans should wait until after the midterms to address immigration.

Hours before the vote, some members of Trump's legislative team -- including Marc Short -- were on Capitol Hill for general meetings when Trump posted his all-caps tweet endorsing the bill he had previously pushed, then abandoned. He referred to the bill as Goodlatte II, referring to Wednesday's bill that was a compromise between leadership, moderates and conservatives in the House Republican conference but whose nickname evoked a hardline conservative bill -- authored by Virginia GOP Rep. Bob Goodlatte -- which failed last week.

Trump's tweet encouraged House Republicans to "PASS THE STRONG BUT FAIR IMMIGRATION BILL, KNOWN AS GOODLATTE II, IN THEIR AFTERNOON VOTE TODAY."

While the White House officials did manage to talk to some lawmakers about the legislation, the timing of Trump's last-minute intervention left few opportunities to push the bill, a White House aide said.

Read More