I find that your test script runs fine, both with current gretl and with gretl 2023c as built today from the historic sources using current gcc. I'm afraid I'm not in a position to test with the original Debian build of 2023c, but actually there wouldn't be much point in that since there's nothing we can do to fix a release from two years ago, even if we could replicate a problem and figure out its cause.
If you're feeling adventurous, you could download the current deb file from debian testing and install it by hand via the dpkg command, along with its dependencies.
Alternatively, there's a bash script that makes building gretl on linux machines relatively straightforward. Go to the main gretl webpage and look for the words "However, if you're on Linux and want to build current gretl". I know of quite a few people that use this script to compensate for the fact that the version of gretl you get on some distros, such as Ubuntu, may be quite old.
-- ------------------------------------------------------- Riccardo (Jack) Lucchetti Dipartimento di Scienze Economiche e Sociali (DiSES) Università Politecnica delle Marche (formerly known as Università di Ancona) r.lucchetti@univpm.it http://www2.econ.univpm.it/servizi/hpp/lucchetti -------------------------------------------------------