If the kernel you are going to flash is supported for the rom you currently have installed, then it's just a matter of flashing from recovery or from an app. Kernels built by Anykernel preserve root and if you are flashing boot.img, then you need to root again. I rare cases, you need to flash stock boot.img before flashing the new kernel if you run into issues.
I'm happy that you got it working finally after many failed attempts..
BTW, did you flash nethunter rom overlay zip or directly installed nethunter app and installed chroot from sdcard?
Coconut Kernel for LineageOS 17.1 - With Nethunter Support
***I wont be responsible for any problems that might occur flashing this kernel or what you do with the kernel support***
I know that the device is pretty old and there may be other kernels available too. But I'm just posting this as i recently compiled it for myself.
Just flash the kernel from recovery.
You can use this kernel for nethunter functions and other chroot applications like Linux Deploy.
HID patch and DriveDroid patch is also included.
Note:- The USB Wifi adapters firmware is also included with the zip and will be automatically installed. No need to use magisk module for installing firmwares.
I may later post a kernel with nethunter support for Havoc OS too if anyone's interested.
Do a wipe. Then install lineage17.1. Flash magisk. Then flash the kernel. Keep in mind that this is only a kernel to support the nethunter functions. So flashing this won't give you nethunter app or chroot. You need to separately flash nethunter rom overlay for your device or manually install nethunter app from nethunter app store and install chroot from inside the app.
Edit.. I think I misunderstood your question. So you were asking for the nethunter rom flashing bootloop. In that case do a wipe and follow the 2nd method i suggested above. You can also try flashing the generic image available in the nethunter download page if your device specific rom overlay fails.