[Magisk] Barium:
I posted the same problem here (did not notice/checked SELinux back then and sound is probably also not working), figured out that all sensors do not work, checked with "Sensor Test" app. I was already considering a separate thread, thus I'll continue here, because this issue definitely deserves a separate thread. Documentation is so scattered and sometimes so confusionly described, that it was hard to make sense of it all...

(Disclaimer: Although I have necessary experience with installing custom ROMs etc., everything stated below is at my own understanding :) ).

My device: Samsung Galaxy Tab S5e LTE

My goal was: TWRP, LineageOS and Magisk. How hard can it be?

Problems are that (most of the) Samsung devices do not have a "ramdisk" partition where Magisk is normally installed, also the increasingly complexity of encryption en integrity checks makes this more annoying.

First, let me retrace my steps, as far as I can.

When reading the TWRP page, we get a clue where to start: "You are therefore strongly advised to first root your device with Magisk and then pre-root a TWRP image before flashing it to recovery", this is because "Both TWRP and Magisk-rooted Android boot using the recovery kernel, with the device's hardware keys used to choose between TWRP and Android at boot time".

(Magisk "hijacks" part of the recovery partition, since the absence of a ramdisk partition.)

Spoiler: later on you learn this is not completely the case any more, but I would still recommend to hold on to this method, because the TWRP page also states that: "The usual path of installing TWRP prior to rooting is problematic on this device, because the Magisk installer does not support installation to recovery from TWRP. Furthermore, prior rooting of the device with Magisk carries the significant advantage of disabling various device protection mechanisms that you will otherwise need to take care of manually.", and it continues with more scary warnings...

1. Thus followed the Samsung section of the Magisk documentation to have the bootloader unlocked and Magisk installed, but stock firmware is still installed, no problem whatsoever.

Then decipher the already mentioned instruction: "...pre-root a TWRP image before flashing it to recovery". This apparently means that Magisk has to patch the TWRP image, just like as was done with the Samsung firmware.

2. Downloaded the *.tar file of TWRP, extracted the image, patched with Magisk and repacked to the *.tar file with 7-Zip in order to be able to flash it with Odin (see step 4).

*3. I do not recall when I installed the "VBMeta file", although this is instructed in the Lineage OS installation instructions, when following the TWRP instructions it says "...you can now jump to its own section", thus skipping it?? (I did it somewhere in the process...)

Unknown: whether it is still required to patch and flash VBmeta (to disable some verification process)...

4. Flash TWRP recovery, see YouTube video below. This video mentions the use of "multidisabler-samsung", which disables "FBE, proca, Vaultkeeper and auto-reflash of stock recovery on Samsung Pie devices". Current latest version was 3.1, downloaded from this XDA post, I think.

Just as in the YouTube video, I also was stuck at the Samsung logo. After booting into the stock firmware you can check if Magisk still works.

Not sure: "multidisabler-samsung" needed?

5. Install LineageOS (and GApps). The most straightforward step, just install LineageOS, read the instructions. Then install GApps (e.g., BiTGApps).

6. After booting (power and volume + button) and setting up LineageOS, a Magisk icon should be visible in the app drawer, click it and the Magisk app is installed, when opened, Magisk is setting up a few more things and reboots the tablet.

*******************************************************************************************

This is the point were you finally think you made it, but no, here the issues arise.

Issues thus being SELinux permissive status (Xandros Darkstorm), no sound and non-working sensors, thus "auto rotating" feature is not working.

At this point I started to regret my purchase...

In the search of a solution to the problem I stumbled upon the following familiar and solved Magisk issue #4911 (LineageOS 18.1 no sound and no sensors after booting with Magisk), which refers to issue #4394 (Magisk > 21.4 is difficult to install on LineageOS (18.1) with TWRP (Direct Install not enabled unless you use old zip)).

In short: this post mentioned patching the boot image instead of the recovery image.

*******************************************************************************************

I. I extracted "boot.img" from the LineageOS zip file, patched it via Magisk (ramdisk is added to the boot image) and replaced the "boot.img" in the zip file with 7-Zip.

II. Booted into TWRP, flashed an original TWRP image, so recovery is replaced. (Rebooted I guess.)

III. Then wiped previously LineageOS installation and, flashed the LineageOS zip file with patched boot image and GApps and rebooted to system.

IV. After setting up, install Magisk, let is do its thing.

V. I installed "Root Checker Basic" in order to check I gained root checker. It was a PASS! And checked with "Sensor Test" if all sensors worked, they did! And sound also worked :).

Yay!

Clearly, all of this can be optimized. Some questions remain, what steps are really necessary and I am also still wondering how to apply a LineageOS update... Anyhow at least it is working.