In your script provide schema info of soa.delete_instances() is a procedure available in XXX_SOAINFRA user --> SOA package and delete_instance() is the procedure that you are calling. In my case it is PROD_SOAINFRA check in your environment and provide corresponding details. The script i provided worked on 126.96.36.199 version.
Yes it is giving count as 0 but when i do a select count(*) from composite_instance alone it give me a value of 396. I checked the table and the date is between 14th April 2013 to 15th May 2013 when difference instance got created.
It seems may be their is some issue with the data time standard which is not able to find the value accordingly.