The documentation (https://docs.servicenow.com/csh?topicname=c_GlideFormAPI.html&version=latest) mentions to use the sys_id to hide a list through a relationship.
Instead of passing just the sys_id of the defined relationship, you will also need to prepend it with the following string 'REL:'
The syntax will be as follows:
For example, to hide the "Incidents by Same Caller" related list on the incident form.
Use the script below: