I can replicate it even with native code with 4.0.1.2704 fbclient (and same server). I'll create GitHub issue.
-- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel