Sometimes, installing an add-on service called User Profile Hive
cleanup can assist with shutdown. However, if you receive a BSOD
then it's likely a system service or driver that faults on unloading.
I would check the System Event log and see if any errors are present.
Just as Services are interdependent for boot up, I would suspect that
the reverse is true when turning off the PC. (Logical order to stopping
processes and services).
It could also be "remnants" of a recently uninstalled application that
left behind some service, if that condition applies.