I wrote up the guard clause pattern because most functions I read still have the arrow shape. The code works, so nobody touches it.
Guard clauses are about what the body is allowed to assume. A function that checks null, type and permission at the top and returns early on each has told you three facts before you read a line of the work. A function that nests the same three checks has told you nothing until you’ve counted the closing braces at the bottom.
That’s the operational part. Once the checks sit at the top as separate returns, a reviewer can argue with the assumption itself. Is this function really the right place to enforce permission? Should that null be possible at all? Buried four levels deep, nobody asks.
The pyramid is a hidden preconditions problem.

