Aircraft sitting on a gate ready for dispatch do not normally have gear down locks fitted. They are usually only required for testing/maintenance and towing.
The fact that the nosegear has tried to retract on ground points to either a cmc test being run (or other maint or retraction selection) without downlocks fitted, or some serious system malfunction that may cause this to happen. Unless a tractor/tug has tried to drive off in a hurry without disconnecting.