Are you suggesting proprietary software is safer than open source?
GrapheneOS is open source and more secure than stock Pixels and MacOS is closed source and more secure than traditional desktop Linux. Open source does not make software more secure by itself and neither does making it closed source.
You said that.
It is perfectly valid to have OSes that are more memory safe by default, and are also open source at the same time.
Not sure what licensing has to do with software engineering or system design.
I’m sure there are proprietary systems with fewer memory safety vulnerabilities than Linux (and many others with more).