Using `Z_THREAD_STACK_BUFFER` instead of `Z_KERNEL_STACK_BUFFER` can cause memory corruption when userspace is enabled. Refer to the PR for details.