The early B747s had a design deficiency in the cargo door locking mechanism, as this involved a PCF conversion of a more modern type, that shouldn’t have been an issue. Due to the door being located on the upper fuselage, at least the engine on that side wasn’t affected.
Human factors come into question, with the return landing being at 05:47 local the crew, both flight and ground, may have been on duty all night or had a circadian low reporting time.