How would I access /system with read-write permission? I do not have TWRP. I use LOS recovery.I build ROMs, and include the stuff as part of the build process.
Regarding "write error": You are aware, that the /system partition is mounted "read-only" on a running Android system, right? So you should do such things from a running recovery with /system mounted "read-write". I assumed you did it that way.
If that is not possible, you need to remount the system partition "read-write", which requires root access (which you obviously need anyhow). Nevertheless, messing with the system partition, whilst the Android OS is running, is dangerous and can have unexpected side effects, so doing that from recovery is the method of choice.