Dumb Question-The Nutrition Behind Calories in/Calories Out

So I've seen lots of posts in these forums through my time browsing them (which I do much too often haha) asking about "If I eat a lower amount of calories all in junk food, will I still lose weight?" Generally, the answers I've seen say, "Yes you'll lose weight, but you'll be really unhealthy and not at all nutritious."

So what about the reverse of that? If I eat all "clean" healthy food, but a high amount of calories (higher than my TDEE so I would gain weight) would I be a healthy overweight person? Or does this not work both ways? It just occurred to me and I was wondering haha.