Is there a way to root a Samsung Galaxy S4 running LineageOS 17.1?
It seems to be a Magisk 22.0 bug (issue #3949).
Rebooting into download mode (Home + Volume Down + Power) and running

heimdall flash --RECOVERY Magisk-v21.4.zip

rooted it!