I have a standalone Python script that during initialization verifies if the ArcInfo license is being used, and if it isn't attempts to set the license to ArcInfo. It works fine with arcpy/python 2.7/ArcGIS Desktop 10.8.1. However, we are in the process of moving to ArcGIS Pro (v. 2.9) and now this functionality does not seem to be working. When the code runs it never sets the license to ArcInfo, it always stays at ArcView despite there being 4 available ArcInfo licenses on the license server.
I have a simplified version of the code below, of which I have also tested and have the same problem
import arcpy
sLicense = arcpy.ProductInfo()
if sLicense != 'ArcInfo':
arcpy.SetProduct('arcinfo')
if arcpy.ProductInfo() != 'ArcInfo':
bError = True
if bError: print('failed, {0}'.format(arcpy.ProductInfo()))
else: print('worked, {0}'.format(arcpy.ProductInfo()))