The reason is a simple one, your making your practice to easy. There’s no question that the golf course is a far harder enviroment than the driving range, so if your in the same mind set as in the range your swing will struggle to deal with the added pressure and dificulty factor. They key to over coming this is to make your practice harder than playing on the golf course. A simple way to do this is to practice with a harder club than your used to using, A Blade!
A Blade has a far smaller sweet spot, with the design making it far more challenging to use properly. This will make your swing more accurate as it will have to adapt to use it. Remember your swing will always adapt and evolve to over come the task you’ve given it!
So make your practice more difficult and your swing will perform far better on the golf course!