In order to parse flag lists, the engine relies on a master list of flag names that pair their human-readable names with their in-engine representations. In the case of the weapon flags, that list used a value defined to be invalid (yes, this makes sense) as the in-engine representation for a few flags that are, for one reason or another, obsolete. The problem was that I forgot to account for this in the function that does the actual flag parsing, which ended up causing the issue seen here.
As for this new issue: please post the weapons.tbl you're using.