... there is FEDERAL law ... about ... being allowed to TRANSPORT a firearm
You're correct. Unfortunately, there are states and cities (New York state and New York City are examples) who refuse to obey this law. If found with a firearm inside their borders, you will be charged. I suspect you could beat the charge but the states/cities are so stubborn that you would have to take it to the US Supreme Court. Since few people have enough money, or a rich backer, to cover the legal expenses, they continue to get away with it.
Until recently, one had to be a US citizen to register a handgun in Omaha or to obtain a Nebraska concealed carry permit. Effectively, this barred that legal resident aliens from possessing handguns in Omaha or carrying legally. It took lawsuits, supported by NFOA, to get both overturned. To their credit, Omaha and Nebraska didn't put up much of a fight when challenged.
Iowa has a strong state firearm pre-emption law. Lower levels of government are prohibited from enacting ordinances more restrictive than state law. That does't stop them from trying. The Iowa Firearms Coalition (
www.iowacarry.org) is the NFOA's counterpart in Iowa. If you look at their web site, you will observe an ongoing guerilla war with local governments that try to place illegal additional restrictions on firearms.
One sees that same behavior with respect to traffic cameras. There are states in which cameras are forbidden by state law. That doesn't stop some cities from putting them up and collecting a fortune in fines.