After upgrading the vCenter Server, files (such as user scripts) created in the home directory before the upgrade no longer exist.
vCenter Server 7.x, 8.x, 9.x
This is expected behavior.
When upgrading, vCenter Server can migrate configuration, historical, and performance metrics data, but it does not migrate user data such as those under home directories.
If necessary, use WinSCP or similar to back up the files in your home directory before upgrading vCenter Server, and then place them after the upgrade.