I searched through their issues and apparently this is expected behavior. According to this issue, returning 0 if the value can't be determined is a documented output. I couldn't find it in the documentation, but it is what it is.
Furthermore, they don't seem to be willing to add checks in place to calculate a proper value.
So, back to emacs. Maybe it should be fixed on this side? I personally made a workaround in the meantime that checks if these functions return 0, and if they do, they override the pgtk function that returns the display info, calculating the proper values for the mm size. It works great. You can find it here, in case anyone finds it useful.