The Japanese loved using decoy forces and diversions to draw the US Navy into traps, but their biggest mistake was assuming the US Navy would always do exactly what they expected. No plan survives first contact with the enemy, but the Midway operation didn’t even get that far because of US code breakers, the dock workers at Pearl Harbor, and a skin rash. The quick repair work on Yorktown was related to another failure in the Pearl Harbor attack, which was not knocking out the repair facilities.
Had to been tough as an attack pilot to ignore shipping for facilities. Left without a second strike because they had 'won' a huge victory. I'm sure the repair guys were highly motivated when they worked on the Yorktown.