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.