Without watching the replays I would say either you were not aggressive enough or you did something else wrong.
All else equal, gun beats t2 every time.
That "all else equal" is the key part. You get gun at the same time as he gets t2 (t2 takes 100 more seconds but requires 6000 less power), you have to rush in immediately and keep him from finishing his first t1 pd. On big maps if he starts way back and you can't get in, start mml spam as soon as you see he's going t2 (left arm except on cybran). Don't wait until he's got it.
From your comment about being cordoned off in Palms it sounds like you let him build up a bit before going gun and pushing. From your comment about not winning air it sounds like you need to work on your air game.
And of course, if you don't scout, you can't react, so you lose.