Set the oven to 475°F, then warm the olive oil over medium-high heat in a 2 1/2- to 3-quart deep sauté pan, braiser, or shallow Dutch oven, preferably oven-safe. The oil should flow easily across the bottom when you tilt the pan.
Stir the onion, celery, and carrots into the hot oil, season well with salt and black pepper or red pepper flakes, and sauté for about 10 minutes. Look for light browning around the vegetable edges rather than an even brown color.
Stir in the garlic and give it 1 minute to cook. It should smell fragrant without turning dark.
If using the wine, pour it into the pan and loosen the browned bits with a spoon as it simmers for 1 to 2 minutes. Move on when there’s no wine pooling at the bottom of the pan.
Stir in the kale and let it wilt for 1 to 2 minutes. The leaves should shrink and deepen in color.
Pour in the crushed tomatoes, let them reach a simmer, then stir in the cooked beans. If the sauce looks dry or stiff, loosen it with broth 1/4 cup at a time, using no more than 3/4 cup.
Reduce the heat to medium, simmer for about 10 minutes, and adjust the seasoning to taste. The sauce should bubble gently and cling to the beans without leaving a watery pool.
Spoon the mixture into a 3-quart baking dish if the stovetop pan isn’t ovenproof. Spread the beans evenly so the cheese will cover the surface.
Scatter the mozzarella over the beans, follow with the Parmesan, and bake for 10 to 15 minutes. The topping is ready when it’s bubbling with golden-brown patches.
Broil briefly for deeper color if you like, using a broiler-safe vessel and watching the cheese the whole time. Once the top is as brown as you want it, remove the pan and finish with parsley if desired.