Why can't I delete a folder in /config/sdcardfs as root (Termux)? I'm looking to delete a folder that is in /config/sdcardfs. My device is rooted and I'm trying as superuser. I still get the results operation not permitted.
What do I need to do to get the permission to do this.
I have tried to do sudo rm -rf name-of-folder with no success.
I have also tried to do it after running tsu (Termux's version of su). No success.
P.S.
I haven't had any issues deleting in other places even in places I need root permission (for example in the /data folder.
SHORT ANSWER
You don't need to delete anything in /config. What appear inside the directory aren't actual files. They are cleared and repopulated on device restart.
You can't delete /config/sdcardfs directory. SDCard FileSystem (sdcardfs) is a core OS component. Your device (or at least storage) won't be usable without sdcardfs properly configured.
DETAILS
Android is based on Linux kernel. Kernel is the backbone of OS which handles hardware components and many other core functionalities. The other part of OS: userspace talks to kernel space through different mechanisms like syscalls, sockets and virtual filesystems. procfs, sysfs and configfs are common virtual/pseudo filesystems i.e. they live in RAM. Kernel exports information about processes, hardware devices, and drivers etc. to user space through virtual files in these filesystems.
/proc and /sys are mostly read-only, except a few interfaces to which userspace can write some values in order to make configurations. configfs (which is mounted at /config on Android devices) is relatively a new addition to Linux kernel. It allows userspace to make relatively bigger kernel configurations by creating large number of virtual files in sub-directories under /config.
Android uses configfs at least for two purposes:

External storage permissions management
Setting USB gadget modes

In order to make file sharing among apps possible, Android sets fixed permissions on files in external storage (be it physically internal or external). To achieve this, at start, Android used FUSE for filesystem emulation, then sdcardfs replaced it. For more details see my answer to What is /storage/emulated/0/? and Android's Storage Journey, in particular the concept of synthesized permissions.
So it's the Android OS which creates and deletes virtual files in /config/sdcardfs/ in order to let kernel know which permissions to enforce on which files/directories in external storage (/sdcard as well as physically external SD cards, USB drives etc).
Additionally Android uses sdcardfs to assign three GIDs: AID_MEDIA_AUDIO (1055), AID_MEDIA_VIDEO (1056) and AID_MEDIA_IMAGE (1057) to media files by providing their relevant list of file extensions in /config/sdcardfs/extensions/. It's to quickly categorize files without scanning all of them. See some details in this answer.
So deleting something in /config/sdcardfs (and in kernel's other virtual filesystems as well) doesn't make sense if you don't know what you are doing. That would do no good except breaking storage functionality on your device.