If the problem was only in LP, it was enough to delete its folderIt helped to me: delete folder with problem module (luckypatcher in my case) with file manager in twrp from data/adb/modules
Then install Magisk one more time
data/adb/modules/<LP folder name>
Or to place a dummy file into that subfolder, named
disable
to disable LP, or
remove
to uninstall LP (that's the proper way to uninstall a module, just deleting its subfolder or the whole adb folder may leave some unwanted remnants)
You would not need to reinstall Magisk and all other modules etc would survive
The same applies if any other Magisk module causes a bootloop. It's easy to recognize by subfolder names, their corresponding modules.
Even more, every subfolder contains textual file module.prop where the exact name of that module can be found