Thanks for your response Dan, much appreciated.
I've captured many API logs and my problem is that I can't replicate the errors when I'm doing my testing, so I'm beginning to think its something to do with the connection between the end user and the moodle database.
I think I'm right that cmi.total_time is calculated by moodle on the server.
I just did another test and closed the Scorm using 'exit activity' whilst watching the API log and also looking directly at the entries in the database at mdl_scorm_scoes_track.
cmi.Total_time was written in the database on 'exit activity' being selected or when I forced the moodle browser window to close.