Multiple RGB values for a single black
If you over expose your render you can see patern.

Render saved as PNG 8-bit. Nothing is pluged into Surface socket of Material Output node. Tested with Eevee, Cycles, Samples ... all same result. Even if compression is set to zero.



The only difference did PNG saved as 16-bit. Completely black. So I guess OpenEXR will work as well. So the issue comes from output file format.



... and just for lovers of generic graphics - JPEG

 

And as mentioned already - Cryptomatte seems to me as a better friend, especially for material. With this ColorRamp 0/1 option I can't imagine to work on more complex object.