It’s a “this is why we can’t have nice things” situation. There’s no physics problem with overlapping that I know of, but it’s a giant loophole for people who are up to no good.
It’s not so much that you shouldn’t be able to do it as that there’s no way we can do it without a permit.
The water management issue is a bigger deal in some locations.
In the original post, he's sloped the new roof back towards the house - huge issue where I live (Atlanta - we got a lot of heavy rain) since that's going to cause water entry in the basement or erosion on the foundation.
It can also be a fire hazard in many situations. Ex - in my area there's a mandated 10ft gap between the property line and any structure. It's there to prevent people from building right up to the property line, essentially creating townhomes, but with none of the fire/safety planning those require.
All that said - I agree with you, this code is likely there to discourage people trying to skirt around inspections (and because it's easy to spot).
No physics problem? I consider a fully equipment fireman carrying a person trying to squeeze between the house and the shed to be a physics problem. And yes, those situations are considered when codes are written.
The thing to remember about building codes is that they're one solution to a problem. More often than not, one good solution. That isn't to say they're the only solution.
So for new construction or reno, absolutely follow code! Why not?
But for old construction that doesn't have obvious dangers and has served its purpose across decades? Why fix what ain't broke? It's entirely possibly it's a perfectly viable alternative solution.
It’s not so much that you shouldn’t be able to do it as that there’s no way we can do it without a permit.