? I've already established that the inner expression evaluates to NULL!
This is indeed unusual...to be specific here pg_get_serial_sequence returns null in lieu of an error for being unable to locate the indicated sequence. currval is returning null because it is defined "STRICT" and so given a null input it will always return null. currval itself, when provided a non-null input, is going to error or provide a number (which should never be zero...).
I'm wondering whether someone didn't like the fact that currval errors and instead wrote a overriding function that instead returns zero?