I have come across this peculiar problem.
This stp is called every begin of the day of the application startup. A bug got introduced in the stp.
The BEGIN TRAN was placed within IF END but its COMMIT TRAN was placed after the END. Theoretically this should have given error on execution even the once. However, no error got simulated on the first couple of days of the deployment of the stp in the production or QA.
This issue got simulated only when the stp was executed in the query anaylzer and then from the application.
What to be done here?