This issue is not longer reproducible in the versions 3.4 and 11.4.
解决办法
Publish a placeholder script to the intended target portal. This could be nothing in particular or the complete script with the GIS set to a portal which is not the active one in ArcGIS Pro.
The script creates a gp.server folder on the Hosting server. It is possible to modify the script after the fact, by locating it on the server. Here's an example location: C:\arcgisserver\directories\arcgissystem\arcgisinput\LoginGPWin.GPServer\extracted\p20\sym\login.py
Update the script to point to the intended portal. Click Save.