Render the bacon: Add the bacon pieces to a large heavy-bottomed pan over medium-high heat and cook about 10 minutes, stirring occasionally, until the fat renders out and the bacon starts to crisp. Lift out with a slotted spoon and set aside. Pour off the fat, leaving about a tablespoon in the pan.
Caramelise the onions: Reduce the heat to medium-low. Add the chopped onion and shallots and cook 20 to 25 minutes, stirring occasionally, until deeply golden and sweet. Add a splash of water if the pan gets too dry — you want the onions to soften and colour, not fry.
Build the jam: Return the bacon to the pan. Add the brown sugar, maple syrup, coffee, apple cider vinegar, and red pepper flakes. Increase the heat to medium-high and bring to a boil for 1 minute, stirring so the sugar dissolves.
Simmer low and slow: Reduce to the barest simmer and cook 1 hour 30 minutes to 2 hours, stirring occasionally, until the mixture is thick, sticky, and jammy with most of the liquid cooked out. Pull off the heat when slightly looser than you want the finished result — it thickens as it cools.
Toast the sourdough: Toast thick slices of sourdough in a pan with a little butter until golden on both sides.
Make the soft scrambled eggs: Crack the cold eggs into a deep saucepan with the cold butter and set over high heat. Stir continuously with a spatula, pulling the pan on and off the heat every 30 seconds, for about 3 minutes. Season with salt and pepper in the last minute, then stir in the crème fraîche.
Assemble: Spread the bacon jam generously over the warm toast, spoon the soft scrambled eggs on top, and finish with sliced chives and flaky salt. Serve immediately.