Q: Why does this happens ?
A: There's some weird issues with the latest AOSP based ROM that makes encrypted ext4 based data partition unable to be decrypted in both system and older version of TWRP if you're encrypted before (intentionally or unintentionally). This however doesn't apply to F2FS and unencrypted ext4 data partition.
Q: How do I solve this ?
A: There's 2 ways you can do to solve this issue.
The best way and the most recommended way is to repartition your data into F2FS. However it does require you to do a backup beforehand since this will wipe everything in your internal storage.
1. Backup your internal storage from TWRP (either to a SD card or PC via ABD)
2. Format it by going into TWRP and select Format and choose "wipe data"
3. Type "yes" and let the process end.
4. Flash your ROM and GApps.
5. Finish the setup without setting any screen lock so that it doesn't encrypt your data partition.
The other way does is to install a custom kernel is made after 20 July 2018
List of kernel that can boot successfully without the need to wipe /data :
-Xenial b25x or newer
(Got kernel that works and doesn't show up here? TELL ME, I'll add it to my list for everyone's reference)
Link for the working TWRP that can detect Internal Storage :
Jairus' modded TWRP
Or you can look up Orange Fox recovery
(link will be added soon)