Hi Moazzam
Hard to tell from my side. My script doesn't end with the subscreen that you have in yours.
Attaching mine just as an example - as all systems can be setup a bit differently, and mine is a demo system.

Mine has save - then exit - then a pop-up to end

Your script has the subscreen at the end, and I'm not sure what that is.

Can you run a line in debug mode to see where it is failing, i.e. where you're getting the error? That will be the best way to determine what is going on.
Also, please enable EXTENDED LOG from the EXPERT MODE tab. I found in another post that I got that message on another asset transaction, but the extended logs showed the actual posting was successful. You can see that community post here: https://community.precisely.com/communities/community-home/digestviewer/viewthread?GroupId=865&MID=44997&CommunityKey=4418e63a-9f6f-4468-b3f1-0186605ed001
Best Regards,
Sigrid
------------------------------
Sigrid Kok
Precisely Software Inc.
------------------------------