[Moto G6 Plus ROMs, Kernels, Recoveries, & Other De] sgorbach:
After trying many things I managed to lock the screen with a fingerprint hold on LineageOS 16, just like on stock. But it isn't nice and clean.

The way I made it "work" is this: AutoVoice takes over the gesture, Tasker detects AutoVoice opening, kills it (probably killing it is not necesary), then sends the (rooted) shell command to emulate a keypress of the sleep/power button to lock the device. It works, mostly. There are many drawbacks, the main one being that Google Voice Assistant actually opens just before tasker kills AutoVoice so you can hear the double beep before it closes, and also as it is now it requires root, it's far from ideal. The way I'm replacing that gesture really is by using the "buttons" option in LOS settings and assigning the "hold navigation var home" gesture to "lock device".

A bit more technical:

As I suspected, the "fingerprint hold" gesture translates to an voice (audio) assistance request, just like holding an headphone button. That gesture/intent was coopted by Google on Android 4 (see this thread https://issuetracker.google.com/issues/36952750) so it's not configurable, then the intent "android.speech.action.WEB_SEARCH" is sent and it by default opens the google app in "voice assistant" mode. The ony other app I found so far that implements a receiver for it is AutoVoice.

So I brought back the locking gesture by using Tasker and AutoVoice. AutoVoice is a listener for that intent, among many other things, so it can be (somewhat) used to replace Google's app (although it still launches it, only for AutoVoice to work on top of it for custom voice commands, though I'm new to AutoVoice so I could be missing something). The way you select AutoVoice for this function is by doing the gesture after installing it and selecting it as "always".

Then the even uglier part: Tasker (which is a really great app, what's ugly is the hack I built) is used to check for AutoVoice launching, and when the app launches it kills it and locks the device. What's even more problematic is that the internal "lock" function on tasker really locks the device, meaning you can't use the fingerprint sensor to unlock, you must type your pin/draw the unlock code, which is not how the stock rom gesture behaves. So instead of using tasker's "lock" function, I use a shell and send the command "input keyevent 26", and even worse, the shell needs to run as root (although I seem to remember "input" doesn't need root?, so this affirmation needs further testing).

Anyway, this mess is just to "have it working, barely", but it confirmed some of my theories and gives me some ideas. To do things properly I think I'll try building a really small app that implements a receiver for that intent (which I think must be advertised in the app manifest, so a Tasker App is out of the question) and then either sends the order to Tasker to do whatever we configured it to do or maybe just send the shell command itself to lock the screen. I'll try "next year" (meaning tomorrow or in a few days, whenever I have time) and if it works I'll publish the apk so those few of us who miss the stock gesture for locking the phone can get it back properly. I even have the theory that the "long fingerprint hold" on stock for assistant is really a hack of two holds within x msecs since the vibration is activated twice, so with a custom app we could emulate that behavior and even add more gestures like "single hold", "long/double hold", "longer/triple hold", measured by the amount of vibrations to do many things. No promises though, at this point it's just theories and ideas. The same could be done by changing the source in LOS, of course, but I don't think the code for LOS16 on evert is public yet, and while it'll probably be easy to change the short-hold gesture intent, doing more will probably be more complicated than just building a basic app.