I searched through their issues and apparently this is expected behavior. According to this (https://gitlab.gnome.org/GNOME/gtk/-/issues/3115) issue, returning 0 if the value can't be determined is a documented output. I couldn't find it in the documentation (https://docs.gtk.org/gdk3/method.Monitor.get_width_mm.html), 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 (https://github.com/tralph3/.dotfiles/tree/9ab2ab7a2a34827b4912a72c5975edb07d36182f/.config/emacs#display-size-in-milimiters-workaround), in case anyone finds it useful.