"I climbed a mountain yesterday."
From ni is used on a place, it indicates a direction. で is for the place of an action. When the action involves moving up, along, or into something, ni is usually the particle behind it. So に indicates that the mountain easn't just the place where climbing happened, but the thing that was climbed.
The sentence is correct. It's like the sentence
タクシーにのる - I will take a taxi.
When I did the sentence in my head, I also used に. Don't know why.