For Apollo, it wasn't so much a "mistake" as a conscious decision to save weight. The Gemini IMU used 4 gimbals, and so avoided the issue entirely. Apollo dropped the weight of the extra gimbal and instead required the pilots to avoid flying in certain orientations.
I would characterize this more as a hardware engineering choice, with associated work around in software (don't rotate the spacecraft through gimbal lock/Euler angle singularity).