Can you actually recompile your kernel on Mac? And its functional?
I'll bet this isn't even the source code Apple uses, but rather they have a private fork with extra patches (similar to how Microsoft publishes OSS VS Code, but then uses their own proprietary version for releases).
You can, or at least could 5 years ago or so (and I bet you still could now).
However, it involved finding some random blog post on how to do it, and then even once I got it up and running there were some issues like the fans being pegged at 100%. Still, it was mostly functional.
I can speak to that via scuttlebutt from ex-apple friends. Apparently the intel power management code running in macos includes proprietary code from intel that they weren't comfortable opensourcing, for weird reasons.