Thank you very much for the detailed explanation of the problem and for adjusting the code.
I’m not on the dev branch yet, but I’ll make sure to switch and use debug mode to trace the function.
It’s likely that the tip about using the serial number as the Primary Host Disk will need to be incorporated into my process.

At the moment, I have a large number of Windows 11 reinstallations to handle due to the end of support, so it will probably be a few weeks before I have time for this.
I’ll post an update in this thread once I get to it.