This is just one of those things that different creators deal with inconsistently, and there's no uniform approach. Going to warp in-system is only a problem when the writer chooses to make it a problem. So there's just no way to come up with a single rule that explains everything. Personally I tend to treat shots of ships going to warp directly out of planetary orbit as a dramatic shorthand, unless it's clear from the dialogue or story situation that that's what's literally happening.