cant reproduce your error , all sunny on my side
maybe change last line to (setq object-list nil object-safe-array nil dbx nil)
or set some debug points in your lisp editor and see if for example object-list / safe-array is created correctly
else use wblock , maybe not high-tech but if it gets the job done, who cares.
well I'm of to site for a couple of hours now...
ps. and check if your filename has no invalid characters in it