I believe that this is due to a subtle bug in heif-enc related to the HDR/SDR issue.
heif-enc --verbose --bit-depth 12 --uncompressed -o heif-uncompressed-12.heif input_truecolor.png
produces a file that libheif fails to read (returns a null pointer for a plane).
But this works:
heif-enc --verbose --bit-depth 12 --uncompressed -o heif-uncompressed-12.heif input_16.png
The two PNG files are attached.
input_16.png.gz
input_truecolor.png.gz
The resulting output should look like this:
