There may be multiple reasons for your kernel to hang while switching to user-space after executing the IRET/IRETD instruction. Switching to user-space requires the following -
1. A GDT with the TSS. The GDT must be loaded using LGDT and a TSS entry must be present.
2. A TSS must be loaded using the LTR instruction.
3. IRET/IRETD instructions depend on the current stack. The stack must contain the following data in memory for a kernel-to-user mode switch (lowering the CPL, numerically increasing from 0 to 3) -
a) SS - This should equal the user-mode data segment selector. You can look into the GDT tutorial for this value.
b) User-mode ESP - The stack to switch to after coming into user-mode.
c) EFLAG register - This is the EFLAGS register to switch to after going to user-mode. You could push the value with only the IF flag set (1 << 9)
d) CS - User-mode code segment selector. You can look into the GDT tutorial for this value.
e) EIP - Where do you want to jump to in user-mode>
4. Now, the location where you jump to must be mapped as a user-mode page. This means you have to map your kernel code as a user-mode page OR you copy your code to user-space OR you map a multiboot-module in userspace. Otherwise, a fault will occur.
5. The TSS must contain a ESP0 stack. This must be set to a allocated region in the kernel space. When a interrupt occurs in user-mode, the ESP will change to this value only. So, if a page-fault occurs and ESP0 is not set, a triple fault will occur.
NOTE: From your post, I think you haven't mapped your kernel code at a user-mode location.