In 17.X, the variables that control the visibility of the field are not set during the OnOpenPage trigger. This means that the visibility will be set to False.
A workaround for our situation can be the following code, until the product group does not create a more permanent solution and update the final product:
Comming soon