"Failure can be tough, but the agony is compounded when a character fails by the barest margin. When a character fails a roll by only 1 or 2, you can allow the character to succeed at the cost of a complication or hindrance."
"A character manages to get her sword past a hobgoblin's defenses and turn a near miss into a hit, but the hobgoblin twists its shield and disarms her."
I hadn't read the DMG that closely, so it seems really weird to me that it would say this. It's not something that I would have inferred, based on anything in the Basic Rules or the PHB. There
is a line about failure on a check leading to success with a setback, but this takes it way beyond that.
But still, the DMG does say that. You can totally attack, and miss, but still deal damage and then lose your weapon. Not based on the circumstances of the situation, or anything you could have possibly foreseen, but just the DM deciding to mess with you. So you could totally attack, but miss by two points, and then the orc kills you instantly on your own turn. (Although, the syntax is somewhat vague, and "can allow"
could be interpreted that such a failure would only allow the player to make the choice, rather than force such a result; this would be in direct defiance of 1-2-3, though, where the player is only allowed to describe intent and the DM is the only one allowed to narrate resolution.)
The DM
does have broad discretion to do whatever he or she wants, of course. The DM could say that rocks fall, and everybody dies. I don't know why any DM would do that, though, or what player would choose to keep playing in such a game.
The basic rules are: The DM describes the situation, the player states an action to attempt, and the DM narrates the resolution. I guess the unspoken assumption is that the resolution should follow from the situation, and how the player describes the action, and possibly random chance, rather than pure whim of the DM.