Jinoh Kang (@iamahuman) commented about dlls/ntoskrnl.exe/ntoskrnl.c:
You should only call `NtGetCurrentProcessorNumber()` once. Otherwise, the processor number can change if the thread is preempted and then re-scheduled to another processor. This leads to inconsistent values between the return value and the `process_number->Number` output.
In general, you should treat `NtGetCurrentProcessorNumber()` as being volatile.