Basically, they cannot criminalize behavior, then go back and punish all those individuals who violated it prior to the passage of the law.
This is true, but it doesn't apply here. What they do is to criminalize possession of the weapons themselves so the punishable conduct becomes possession of the weapon in the present, not in the past.
As for the 5th Amendment, it doesn't apply to possession of prohibited materials. The gov't didn't compensate owners of narcotics or alcohol when those items were banned.