Peel the potatoes and cut into even-sized chunks (about 1 1/2-inch or 4 cm). Add them to a large pot along with peeled cloves garlic (don't worry, the dish won't be too garlicky). Pour cold water to cover the potatoes. Season the water well with salt. Bring to a boil then simmer for about 10-15 minutes or until the potatoes can be easily pierced with a fork.
Drain the potatoes in a strainer then return to the pot. Cook over low heat for 30-60 seconds, stirring, until all the remaining moisture is evaporated. Take off the heat.
Prepare a 9x13 inch (23x33cm) baking dish. Preheat the oven to 375°F (190°C) (if you're planing on baking this right away).
Mash the potatoes and garlic cloves using a potato ricer or potato masher (potato ricer is best for fluffy mashed potatoes) while the potatoes are still hot directly into the baking dish.
Make brown butter: Add butter and rosemary sprig to a medium saucepan and cook it over medium heat until it's melted, then cook for 2-3 more minutes or until it's golden brown and smells nutty. It should be just light golden brown and not dark golden brown. Reduce the heat when you see it's starting to brown to avoid burning it. Discard the rosemary.
Add the brown butter to the potatoes and stir to combine.
Add sour cream, cream cheese, milk, and heavy cream to the same pot. Whisk until smooth and cook until very hot but not boiling.
Add the mixture to the potatoes and stir until combined. It will look soupy at first but the potatoes will absorb it all. Season with salt to taste and a small amount of pepper (if it's missing some flavor, usually you just need to add more salt).
Even out the surface with a spatula. Now you can put the casserole in the fridge for up to 3 days. When ready to serve, take it out of the fridge and let stand for 30 minutes (optional), then bake at 375°F (190°C) for 45-50 minutes or until hot and browned on the surface. You can also bake it right away.
Enjoy!