Heat 1 tablespoon of the butter in a large skillet over medium-high heat. Add the mushrooms and cook, stirring occasionally, until they soften and exude their liquid and all but about ½ cup of their liquid evaporates, about 10 minutes.
Transfer the mushrooms and their juices to a small bowl.
Add the remaining 1 tablespoon butter to the pan. Stir in the shallots and carrots. Cook until the carrots begin to soften and the shallots start to brown, 4 to 5 minutes. Stir in the garlic, rosemary, salt, and pepper. Cook until fragrant, about 1
minute, then sprinkle in the flour and stir to coat.
Pour in 1 ½ cups of the wine, add the tomato paste, and stir to incorporate. Cook until thick, 2 to 3 minutes.
Stir in the beans and the cooked mushrooms and their juices and cook until warmed through, about 2 minutes. If the sauce has thickened too much, stir in up to another ¼ cup of the wine to keep it loose. Taste and add more salt and/or
pepper if needed.
Serve warm.