U.S. Representative Gary Palmer (first image), who represents Northern Alabama, took credit for an $350M highway earmark in the Bipartisan Infrastructure Framework, a.k.a., BIF).
He voted against the bill.
This may be obnoxious but not hypocritical.
The BIF is one of those aggregate bills with thousands of earmarks (the bill language contains over 1400 earmarks in 1700 pages) and covering many different types of infrastructure including highways, transit, ports, broadband, electrical transmission and more.
Unfortunately, I have personal experience with administering portions of previous aggregate bills, which if they cover most of the government are called Omnibus Bills or if they only cover a portion, miniBus Bills. These typically have worthwhile projects and wasteful projects and sometime the project is so poorly defined it takes considerable time to figure out what it was supposed to be.
My own Representative has lauded several earmarks he got into the bill for replacing diesel buses with electric buses on the premise that this will relieve traffic congestion. Although obviously a false claim (it might even make traffic congestion worse as the current generation of electric buses brake down more often than the current generation of diesel buses but it might save money if the information in the chart is correct, it is from a 2016 study by a graduate student) that is not hypocritical either.
An article on a fire involving an electric bus is here
Yahoo article with image is here
Earmark summary is here.