Well it’s because the installer is offline and it detects based on the embedded key.
So if your unit ships with a Home embedded key, a generic installer will always install back Home version. So use the below generic upgrade key to force a upgrade to Pro and once Windows is back in Pro version, it will fetch your digital license automatically.
Generic Home to Pro key: VK7JG-NPHTM-C97JM-9MPGT-3V66T