Until only recently there was no problem.
A data partition encrypted with one of Fairphone’s OSes could be used with the other OS and with LineageOS 14.1 (Android 7.1), and with TWRP.
Now that LineageOS has gone to version 15.1 using Android 8.1 as its base, it has emerged that somehow Android 8.1 does things differently so that TWRP as of now can’t access a LineageOS 15.1 encrypted data partition. You can still use TWRP just fine for every other task, but it can’t do a complete system backup including the data partition this way anymore.
This problem is not unique to the Fairphone 2, it is widely acknowledged on many devices, but it seems nobody really knows how to “repair” this or it just is a huge task that might take time.
If you want to have access to encrypted data in TWRP while running LineageOS 15.1, the current workaround on the Fairphone 2 is to install LineageOS 15.1 on a system with a data partition already encrypted by an older Android (LineageOS 14.1, current Fairphone OS or Fairphone Open OS).
Not really a problem once you know it, and this way everything works fine as before.