Ok, I removed unnecessary >[-] from the program so that it would look neat: tio.run/nexus/…
So close... yet so far
I know why it outputs null bytes, it's because the TIO interpreter interprets EOF as 0x0a (ie not empty). That is why the program continues and outputs null bytes for EOF