Operating system: Linux-5.8.0-38-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: GeForce RTX 3070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.32.03
Broken: version: 2.91.2, branch: master, commit date: 2021-01-19 16:15, hash: rB5be9ef417703
Short description of error
Set up a scene with compositor tree and a viewer node connected to the scene input. Add a material to the default cube, connect an image texture node to the surface output. Select "Viewer Node" as the image texture. Press render. Result will probably be a purple cube. This is perfectly understandable, however what's not understandable (or at least not desireable) is that this will often still happen even if the viewer node currently contains a valid image. Say you just rendered something into the compositor and you want to preview it as a texture on an object. You can do this with the viewer node, and then tweak masks or compositor settings and see the texture update on the model in realtime. However, if you press render again, even if the viewernode textured model is offscreen, this stops working. In fact, it even breaks the viewer node itself, such that trying to view the viewer node contents in the image editor shows solid purple.
Expected behaviour: contents of viewer node (and probably "render result" as well) should be cached before rendering so blender can use them during the shading process without getting confused. Would allow better editing of objects textured by renders. This already seems to kind of work intermittently, so I don't really consider this a feature request.