The JVM originally also had the goal of providing a security boundary, and even had a relatively complicated permissions/security model enforced via call stack inspection.
That security model was ultimately too complicated for developers to work with, but I don't think the sandbox itself was particularly insecure.