I have this bad habit of answering my own questions. I think I may have solved this by adding
just after setting up the scan_view VIEW.
My biggest question about using bmap_zbuffer is whether this needs to be called for each new level, or just once in the beginning of the game?
I don't fully understand how this works. But so far I have not seen the errors I mentioned. I am reading up in the manual, but a lot of the language about "views" "render targets" is hard to understand.