Although .NET has a new static bool DeepEquals(JsonNode, JsonNode) method, it only returns a simple true/false without detailed information about how the two nodes are not equal.
So you can just serialize your JsonDocument to string and use this library LateApexEarlySpeed.Xunit.Assertion.Json to do "json-level" equivalent assertion. As you considered, library will automatically ignore whitespace and other factors inside and give detailed difference message and position.
JsonAssertion.Equivalent("""
{
"a": 1,
"b": 2
}
""",
"""
{
"b": 2,
"a": 1
}
""");
(I am author of this library)