OK don't panic if in TWRP:
Chances are that because of a bug in some version of TWRP, sometimes MTP gets enabled by default when you go into recovery, thus prevents R/W access to the data partition.
- Restoring a ROM fails at restoring the Data partition
- When you try to format the Data partition you get "Error Sending Message To Add Storage 65537"
- You install a custom ROM successfully but it never fully boot
While flashing the system partition or restoring a backup.
Chances are that because of a bug in some version of TWRP, sometimes MTP gets enabled by default when you go into recovery, thus prevents R/W access to the data partition.
To fix it, in TWRP (obviously!), go to Mount ➡️ Disable MTP and try again