Yes, it works as intended, you can't modify the parent from a child (or the child from the parent)
The two processes (parent, and child) are two different processes, and just like one of your process can't write into the memory of, say, a webserver that is also running on your machine, the parent process can't write to the child process or vice versa.
To avoid having to copy EVERYTHING in the parent process into the child process, the OS uses something called "copy-on-write", which works like this: When a "child" process is made, the pages representing the parent process are duplicated, and marked "read-only". When a write happens, the OS traps that write (which is not allowed, because the memory is read-only), and makes a copy of the memory, so that the process writing to memory as its own copy of the memory [and unmarks the "read-only" on the other process, so it can now modify the data, as it has the original memory content].
As others have said, you can overcome this by using "shared memory" (which can also be shared between completely independed processes if you like).