Usage of sysparm_item_guid in the client scripts for getting the sys_id of the current catalog item works perfectly fine in Platform UI. However, the same script fails to retrieve sys_id in service portal.
The reason the same client script doesn't fetch the sys_id of the current item in service portal is because there will not be any element by name sysparm_item_guid in Service Portal DOM/UI.
The client script looks for a parameter "sysparm_item_guid".
This parameter will not be available in Service Portal. You need to use the 'sys_id' of the catalog item instead.
If the requirement to get the catalog item sys_id in service portal, you can use of the following API instead of sysparm_item_guid:
To know more about the usage of this GlideForm API, please refer to the below product documentation.