You don't withdraw your ambassador "before" you do the inquiry because by doing so, you are pre-judging the inquiry. Israelis (myself included) will apologize if the Egyptian soldier's deaths were accidental but we do not yet know this. Remember, the reports coming out said that the terrorists were wearing Egyptian army uniforms so the situation was very difficult. The bottom line is that this incident was able to happen because of Egypt's loose security in the area and between Gaza and Egypt. Israel will not and cannot rely on Egypt to protect it's people.
Saudi-led coalition air strike kills around 30 Yemeni civilians (Reuters)
from the article: Egypt withdraws ambassador to Israel over policemen deaths