Add olive oil to a large skillet with onions, carrots and celery. Cook over medium heat, stirring occasionally until vegetables are softened. Set aside.
Cook ground beef in another large skillet over medium-high heat, breaking apart as it cooks until crispy brown. Drain the browned ground beef and place in the skillet with the cooked vegetables and set aside. Discard excess grease.
Add 1/4 cup butter to the skillet that the ground beef was cooked in and place over medium heat. Sprinkle in flour and stir until well browned.
Pour in the beef broth, , tomato paste and Worcestershire sauce stirring until sauce starts to thicken. Reduce heat and stir in the garlic, thyme, 1/2 teaspoon salt and 1/2 teaspoon pepper.
Add the gravy, 1 cup at a time to the ground beef and vegetable mixture until desired consistency is reached, we added 3 cups. Simmer 15 minutes. Keep reserved gravy warm for serving.
Meanwhile preheat the oven to 375°.
Place potatoes in a pan and cover with cold water. Boil potatoes until tender. Drain well.
Add butter and milk to the pan and place over low heat. Cook 2 minutes, add the drained potatoes, sour cream, shredded cheese, 1 teaspoon salt and 1 teaspoon pepper.
Beat with electric mixer or use a potato masher until potatoes are fluffy.
Pour ground beef mixture into a 11 x 9 inch casserole dish and spread evenly.
Carefully spoon mashed potatoes over the filling, spreading evenly.
Scrape the potatoes with a fork and sprinkle with finely grated cheese.
Place the casserole on a rimmed baking sheet in case of boil over and cook in the oven for 35- 40 minutes.
Turn the oven onto broil and watch carefully, cooking 3- 5 minutes until potatoes are lightly browned.
Remove from oven and rest 10 minutes.
Serve with reserved gravy.