No sure what happened, but CPU restarts in case of a
Triple_Fault.
Briefly, it means that a fault occurred while trying to execute an interrupt handler, a software exception triggered by your user code in this case, and that there was no double-fault handler or if a fault occurred while trying to execute the double fault handler itself.
One of the reasons for a fault to occur when the CPU is trying to execute an exception handler is being unable to write to the stack.
That's why Octocontrabass asked if you did setup a
TSS. The CPU needs to know which ESP and SS to use in case an
interrupt occurs.