Hi SP RA,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
We understand from your query that you are experiencing an issue while trying to upgrade windows server 2016 to windows 2019/2022. I have shared troubleshooting steps that I felt will help resolve the issue you reported.
Run SetupDiag, a diagnostic tool from Microsoft that examines Windows setup log files to identify common issues. It may help identify the specific component or process responsible for the hang. Download the file and run it. For detailed information visit https://learn.microsoft.com/en-us/windows/deployment/upgrade/setupdiag
Even if you have sufficient space, temporarily increasing the OS disk size can sometimes facilitate the upgrade process. You can expand it and then revert to the original size once the upgrade is finished.
If the in-place upgrade continues to fail, consider capturing an image of your VM, then attach an OS disk of the target version to preserve your applications and configurations.
Please let us know if you have any further queries. I’m happy to assist you further. If the answer is helpful, please click "Accept Answer" and "Upvote it" as it can be helpful to others in the community.