I am trying to create a graphic similar to the following one from another question on here: 
But already when i try to render a colored transparent surface of a simple plane, something is not looking right. With the following code
import bsp;
size(15cm,0);
settings.outformat = "pdf";
settings.render = 5;
currentprojection=orthographic(5,4,3);
path3 pl = plane((0,-6,0),(-6,0,0),(0,3,0));
draw(pl);
draw(surface(pl), red+opacity(0.5), nolight);
I am getting the output

although the surface of the plane should be rendered fully in red with opacity 0.5. When I remove the opacity(0.5) option, as in
draw(surface(pl), red, nolight);
i get the desired output:

But even when I straight up copy the code from the answer to the other stackexchange question, the described issue remains:

I already tried searching for an explanation for this behavior in the documentation and in other posts on this stackexchange but so far wasn't successful in finding any answers. What am I doing wrong?
EDIT: I am rendering the asymptote code in a .asy file with the asymptote CLI, not in an asy environment in a latex document. I would also want to keep it that way, i.e. render my asymptote graphics separately with the CLI and later insert them into my latex document.
EDIT 2: When I compile the asymptote code in an asy environment in a latex file with pdflatex, the resulting plane.asy file is:
if(!settings.multipleView) settings.batchView=false;
settings.tex="pdflatex";
defaultfilename="asymptote-1";
if(settings.render < 0) settings.render=4;
settings.outformat="";
settings.inlineimage=true;
settings.embed=true;
settings.toolbar=false;
viewportmargin=(2,2);
import bsp;
size(15cm,0);
settings.outformat = "pdf";
settings.render = 5;
currentprojection=orthographic(5,4,3);
path3 pl = plane((0,-6,0),(-6,0,0),(0,3,0));
draw(pl);
draw(surface(pl), red+opacity(0.5), nolight);
and the output is
Thus, the plane is still not being rendered correctly. Previously I compiled a test .tex file with my asymptote code in it on Overleaf (also with pdflatex) and the plane was rendered correctly to the produced pdf. I should have clarified that in my first edit. In conclusion, my issue must be a local issue. I want to compile everything on a MacBook Pro (M1) and cannot remember changing any of the default settings of the asymptote CLI.
EDIT 3: Now I tried installing a different version of asymptote on my Mac. I was using version 2.85 (which comes preinstalled with texlive/mactex). Today, I installed version 2.89 separately with homebrew and compiled my code again - sadly, the issue still remains. Also, since I posted this question, I reinstalled MacTex (and thus texlive), yet I am still running into the same issue. And of course, I also tried the old "Restarting your PC" trick.
EDIT 4: I edited the title a little as I found this to be a more general issue on my machine when trying to compile different surfaces from the documentation. Namely, I found a similar (as I think related) issue, when I compile a surface from page 138 of the documentation: Compiling
import bsp;
settings.outformat = "pdf";
settings.render = 5;
size(15cm,0);
draw(surface((0,0)--E+2N--2E--E+N..0.2E..cycle), red);
produces
as expected. But adding +opacity(0.5) as in
draw(surface((0,0)--E+2N--2E--E+N..0.2E..cycle), red+opacity(0.5));
produces

pdflatex,asyandpdflatexto reproduce my original result. So it is hard to know what you're doing wrong without knowing what you're doing. Are you sure this is not just a view artefact? – cfr Mar 04 '24 at 03:55asyenvironment in a latex-document but separately in a.asyfile with the asymptote CLI. Indeed, when I copy your code into a latex document and render it that way, everything works as intended. still, I'd want to render my asymptote graphics separately with the CLI and later insert them into my latex document. – derdu Mar 04 '24 at 22:08prawf-2b.asyand runasy prawf-2b.asy, I get the expected result and still cannot reproduce the output you show. Even if I compile it using theasyenvironment in a document, I'm still rendering separately usingasy. However, some extra stuff gets added to the.asyin that case. But, as I say, it does not seem to affect the rendered result in the case of your 50% transparent red plane, at least. – cfr Mar 05 '24 at 01:15