Then how is Jordan able to prevent the guard from leaving ... if the guard is already in Israel?
Embassies are considered property of the country the Embassy is for. So as long as he stays on Embassy grounds he is in Israel. Unfortunately he steps out the gate he’s gone into Jordan.
This is why Asylum seekers will attempt to crash the gates of embassies around the world.