If you do thorough risk assessments and equality and impact assessments, single sex designs with door gaps will always be safer. For staff and customers
Maybe you've already considered this point, but there's one more reason the design on the right is more of a problem for your illustration scenario than a single enclosed toilet in a café or whatever.
I can imagine some people saying "well, if you can have one in a café, why not six?"
An answer is - if there's only one, one being occupied for a prolonged period has a reasonable chance of being noticed fairly soon by someone waiting for it.
If there's multiple, it could go unnoticed far longer. There's no reason for any customer passing through to investigate one locked cubicle out of six.
The same argument would extend to having 2 sexed enclosed toilets in a café rather than two unisex. The split maintains traffic to both, prompting investigation.