In a large saucepan or soup pot, melt the butter over medium-low heat.
Add the onions with a pinch of salt and pepper and stir to coat them in butter. Cover and cook for 15 minutes, until they soften and release their liquid.
Uncover and keep cooking over medium-low heat, stirring every 10 to 15 minutes, until the onions are deep golden brown and jammy, about 60 to 75 minutes more. If they start to stick or scorch, lower the heat and add a splash of water.
Raise the heat to medium. Sprinkle in the flour and stir for 1 minute to coat the onions.
Pour in the red wine and stir, scraping up the browned bits from the bottom and sides of the pan.
Add the cayenne, lemon juice, thyme and bay leaf, then the beef and chicken stocks. Bring to a boil, then lower the heat and simmer for 10 minutes. Remove the bay leaf and season with salt and pepper to taste.
Meanwhile, heat the broiler to high. Toast the baguette slices under it for 1 to 2 minutes per side, until lightly golden.
Ladle the soup into oven-safe bowls set on a baking sheet. Top each with a slice of toasted baguette, then the Gruyère and Parmesan.
Broil for 2 to 4 minutes, watching closely, until the cheese is melted, bubbling and browned in spots. Garnish with parsley if you like and serve right away, warning everyone that the bowls are hot.