You have right, there is a bug and the big one! I suppose that index of Foreign Key is not validated by existence of value in the record itself and its (the record version) transaction numer is not compared to snapshot number.
Please report a bug to the tracker. regards, Karol Bieniaszewski
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel