I think all they had was an outline from GRRM once past the books. They probably thought he'd give them more material and when that didn't happen had to pivot to writing. And well Hollywood happened...
They simply aren't able to put as much planning and plotting in place to avoid creating these plot holes.