Laptop Freezes when power cord is plugged in or unplugged

hi! i put together a hackintosh a few months ago ith my dell lattitude E7270 got it running big sur fine upgradeed t monterey still fine. a few weeks later i noticed that pressing f12 or unplugging and plugging in the laptop made it completley freeze. i have changed the ram resinstalled mac os formatted the ssd used lower and higher amounts of ram used patches of ssdt XOSI and rebiult my efi from scratch. i dont know where to start. i got it to stop doing it when i click f12 however still when the power is removed or added the laptop freezes. if anyone knows a fix please let me know. ( i also noticed that sleep stopped working when the other problem started)

-Thanks

specs

i-5 6300 cpu 6th gen

16gb ddr4 2133 mhz corsair

512g nvme ssd samsung 970 evo

intel hd 520 graphics

alc code =11 (audio)

submitted by /u/Zealousideal_Use9642
[link] [comments]