Place potatoes, unpeeled, into a pot and cover with salted water; bring to a boil. Reduce heat to medium-low and simmer until tender, about 20 minutes. Drain and cool until easily handled; peel and dice.
Melt butter in a large skillet over medium heat. Add mushrooms; cook and stir until browned, 8 to 10 minutes. Remove from heat and let cool.
Cover the bottom of a mold with 2 diced eggs. Layer 1 onion, 1/4 cup mayonnaise, 1/2 of the mushrooms, and all the potatoes on top. Spread 1/4 cup mayonnaise, all the cornichons, remaining eggs, and another 3 1/2 tablespoons mayonnaise on top. Finish layers with remaining onion, mushrooms, and mayonnaise.
Refrigerate until firm, 1 to 2 hours. Invert onto a serving platter and lift off mold.