It looks like there might be a code order issue on this page. Currently you have the email occurring immediately after the order is confirmed. Instead the order should be stored in the db so that the session variable can be set properly first. Once the variable has been set the email should contain the correct order number.
The email getting sent before the variable is set would account for what you are experiencing. If you had done more than one test you would be seeing the order id for the previous order rather than the current order. If the test was by itself you would probably not see any id
I have made an update to this page by moving the UE code to be just after the store order summary server behavior. Please give this a try to see if it resolves the problem.