ASME B31.4 This code (as do most) only tell you what you must do. Anything else you can do safely, or otherwise demonstrate is safe in your particular situation, by test, calculation, by experience, or however else you can justify, is allowed.
Buried valves, or flanges are not prohibited.
Valve boxes, or vaults, are not prohibited. Many companies prohibit valve vaults in their standards and some require them.
If you believe it is safe to bury your pipeline, valves and flanges included, it is not prohibited.
you must get smarter than the software you're using.