How can I reformat internal storage on Android?
check your file system type is ext4 or f2fs with mount  

in TWRP you can format from command line (beware this is factory reset /data and /sdcard is lost)  

adb shell
umount /sdcard /data
mount -r /system
mount -r /vendor
export PATH=/system/bin:/sbin
export LD_LIBRARY_PATH=/system/lib64:/system/vendor/lib64:/vendor/lib64:/system/lib:/system/vendor/lib:/vendor/lib
/system/bin/sh
mke2fs -t ext4 /dev/block/sda44 [fs-size]
or
mkfs.f2fs /dev/block/sda44 [fs-size]


Note: fs-size is optional. depending on encryption method you may reserve last -16384 bytes for encryption footer. in this case calculate sectors