This is likely because you have forgotten to switch on the Fuel Pressurisation Switch, located just below the fuel quantity gauge.
This switch is required to be ON when flying above 12,000ft altitude. It prevents vaporisation of fuel in the tank which can occur due to pressure changes in the air at altitude. With the switch OFF, the fuel in the tanks are not sufficiently pressurized to be used by the engine, and results in the engine failing.
If this happens to you again, be sure to set the fuel pressurisation switch ON and then try to restart the engine.