Cube washed sweet potatoes into ¼-inch pieces. Place on baking sheet. Drizzle with olive oil and mix to evenly coat the potatoes. Spread into an even layer. Sprinkle with salt and pepper.
Roast in the preheated oven until browned and tender, 25-35 minutes.
Remove from oven and set aside to cool. Reduce oven to 350°F.
For the white sauce
In a saucepan, melt the butter over medium heat.
Once melted, add the flour and whisk to incorporate. Continue to cook until the mixture coats the bottom of the saucepan and the raw flour smell has subsided, 1 minute.
Slowly add the milk, a few tablespoons at a time, whisking until smooth between each addition.
When the milk is added and sauce is smooth, whisk in the salt, pepper, and sour cream. Set aside.
Spray 12 8-ounce ramekins or one 9×13 inch pan with nonstick baking spray.
Evenly fill the ramekins or pan with the prepared sweet potatoes and then the ham. Dice the hard-boiled eggs and add them on top. Sprinkle on a small amount of cheese. Pour the prepared white sauce over the top, spreading slightly to ensure it’s distributed throughout the casserole. Top with the remaining cheese and place on a parchment-lined baking sheet.
Bake until the casserole is warmed through and the cheese has browned on top, 25-35 minutes.