What's the piping design application that leads to this setup? Perhaps we can assist with proposing alternate designs that still meet the original intent.
As others have mentioned, there's nothing in code that prohibits such an assembly, but NDE and welding may become more challenging, depending of course on flange size and rating.
The only time I think I've come across this at my shop is for retrofits where existing piping can lead to unusual piping design choices.
Are the two flanges identical, or different in some way? If you're just needing to make up a certain dimension that prevents you from using a pup in between, we've sometimes used very thick bleed rings (with or without taps), and assembled a wafer style joint. This may or may not make sense depending on your application, but at the minimum, it eliminates one more weld that needs to be tracked and inspected.