Hi Gabriel,
I fully agree, the isnull condition should suffice, and in fact I've just tested without the true=true condition and it still working.
At the time I added true=true, I was rewriting the whole condition so probably something else was preventing the records to show at form load, but now the condition is like this, and it works as expected for a where condition in an SQL statement.

This is the SQL statement generated:
SELECT "r0"."id" AS "e0", "r0"."name" AS "e1", "_r0"."id" AS r0id
FROM "desarrollo_sostenible"."book" AS "r0"
WHERE (((NULL IS NOT NULL
AND "_r0"."id" = ANY ($1))
OR NULL IS NULL ))
If I understood correctly, variables are NULL until a value is assigned. So when the form loads the variable is NULL, and that is why the isnull condition succeeds.
I guess that something went wrong with my REI3 instance yesterday, because now I've delete the isnull condition and its not showing the error on form load nor in the SQL preview anymore, it just doesn't load the records of the list, as the condition resolves to false, and when I put it back records are shown in the list even before selecting any value for the variable.
Anyway, now its working according to what should be expected. What happened yesteday and that strange behavior, I can't say why.
Thank you!