If you want a fix now, install one of Fairphone’s OSes (Android 6 currently), set a lock screen pin/password/pattern, then encrypt the phone, then install TWRP 3.2.3-0 and wipe everything (only wipe, no format!), then install LineageOS 15.1 . That way TWRP can still access the encrypted data partition, and LineageOS 15.1 is fine with it, too.
I installed LineageOS 15.1 for microG on prior encryption myself, works like intended.