While working on the PEP 658 (#1047), we ran into issues recreating missing package metadata files because of domain handling problems (#1067, #1071). Later, we also fixed an edge-case bug that occurred when creating the metadata file (#1101).
This task is to add support for recreating missing metadata files and fixing existing ones for all older packages.