My guess is that you are outside the loop and have to do has_post_thumbnail(get_the_ID()) for the code to work the way you want. I am basing that on the way you are calling get_the_post_thumbnail().
I was definitely in a while loop but after testing what has_post_thumbnail gave pack I found it was true no matter if the post has a featured image or not