The evals are there because this test code is an extract of the larger program were I originally encountered the problem and there they are necessary (at least AFAIK), but the point isn't whether my code is optimized or not, the point is the weird behavior on the M1/M2 Macs, on all other systems I tested it on the code works fine and provides the expected correct result.
If you are curious the original program is here: http://obd-amigos.linuxtech.net/files/