Hi Hampus Söderberg,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Based on the detailed explanation provided, the deployment issue you're encountering is due to a mismatch in the registry keywords for VLAN settings on your network card. Here are some steps which help to resolve this issue:
Verify that your NIC driver is up to date. Sometimes, driver updates can resolve compatibility issues.
Confirm that the Realtek RTL868H NIC driver is certified and compatible with Azure Stack HCI 23H2.
If modifying the script is not feasible, consider using a different network adapter that uses the "VlanID" registry keyword.
If an answer has been helpful, please consider accept the "Answer" and "Upvote" to help increase visibility of this question for other members of the Microsoft Q&A community.