When I try your script on current sources I get an error about
the values being too long for the varchar(15) on some of the
inserts. My guess is that on the older version the varchar(15)
is truncating and making it different from the varchar(80) in
the referenced table so it really is a foreign key error.