Re-opened an early version of my game with Godot 4.0-stable that I abandoned around Beta 4 (and moved to Unity), and tried to add an Outline shader again (source). It finally works! Viewports were broken during the betas.
The only problem is that the SubViewport AA is not good, you can see how aliased the outline is. Even with MSAA x8. And TAA removes the transparency from the SubViewport. But I think I can live with that.
Reducing the line thickness makes the aliasing even more noticeable, but I can live with that too - I think: