United States v. Lopez, 514 U.S. 549 (1995) invalidated the Gun Free School Zones Act as an impermissible exercise of the commerce clause power. In it's opinion, the Supreme Court instructed Congress how to draft a Gun Free School Zones Act that would survive judicial scrutiny, and be a permissible use of the commerce clause power.
All Congress had to do was add the phrase "or affects", preceding "interstate commerce."
Scalia is a big fan of this extension of federal power. He used it to uphold federal prohibition on pot in the Raich case. It was also used to reverse a gun case (not school zone), after the 9th Circuit found that a homemade gun, that never left the state, isn't an object of interstate commerce.
I would agree, though, that Scalia completely reversed his position with Raich, and told the 9th circuit to use Raich to reverse the decision on the homemade gun ruling that was based on Lopez.
I think that the 9th Circuit deliberately made the gun ruling to try to provoke a reaction from the Supreme Court, and they succeeded very well.