Kernel Panic when booting into Mac OS. iMac 27 2017

bootcampinternetinternet-recoverykernel-panicrecovery

A few months ago, I was using the iMac and opened up spotlight search and there was my first ever kernel panic. It restarted then I logged back in and everything works fine.
(The report is at the end)

After a month, I had 2 QuickTime player windows open, a Final Cut Pro window, a Chrome tab with only 8GB RAM. A kernel panic happened and I was able to log back in and opened up chrome and started watching a YouTube video, after a minute or so, another kernel panic happened and another one after reaching the login screen. It kept restarting (it's like the Kernal panic countdown started getting shorter to the point where it wouldn't even reach the login screen. After a few restarting, it showed a ''prohibitory sign'', after 30 seconds it shut off. I tried booting into Recovery mode but no luck. I tried booting into internet recovery, the globe did a quick spin and went into the same apple logo and progress bar and it did a kernel panic. I pressed Alt at startup and selected my BootCamp drive (Windows) it booted with no problems at all.

It's been a few months since my last interaction with Mac OS. Every time
I boot I have to hold down alt and select BootCamp. I'm currently writing this post on my BootCamp drive with no problems at all. Video editing works better than Mac OS. The reason I got an iMac is to use mac os and not windows or I could've just got a PC instead. So I would like to fix the Mac OS portion of this iMac.

SPECS:
Mac OS Version: 10.14.2 (I think)
iMac 5K 27'' 2017
3.8GHZ core i5
8GB Ram
2 TB Fusion Drive
Radeon Pro 580 (8GB) Graphics Card

Kernel Panic Report

Best Answer

First you should try removing any third-party, external peripherals you have connected to your iMac. If the problem persists, and your observations are correct, then you have a hardware error with your iMac. You should contact Apple or the dealer for repairs. You can also use the built-in hardware test to search for errors, but be aware that it only catches a small subset of possible errors.

The reason I say this is that when you boot into Internet Recovery, it is not using any information from your macOS installation or from your hard drive in general. If that kernel panics during boot, you have a hardware problem.

There are many possible reasons as to why this seems to only affect macOS and not Windows in Bootcamp. You could be lucky that you're not hitting the faulty hardware, and it could be that Windows in general does not use that portion of the hardware - or that flaws in that piece of hardware is inconsequential for Windows (or at least you haven't noticed the problem yet).

The actual defective hardware could be many things, but it is often faulty RAM or similar component. The hard drive is not used for Internet Recovery, but there's a small chance that a defective hard drive could interfere anyways - however, in that case you shouldn't be able to run Windows from the same drive.