Boeing made a bet on the 787. However, as you note, that's an easier bet to make when you already have the 747. Boeing already had a jumbo. It's easy to make a bet on twin-engines getting certified for longer ocean crossings when you already have the 747. There's a lot of things that Boeing bet on with the 787 and you're totally right that it's way easier to make those bets when you already have the 747. However, they did make those bets and, in hindsight, it looks like they were better moves.
The A380 is really built for hub and spoke systems which is one of the reasons Emirates uses it so much. Emirates almost exclusively goes through Dubai and so they're able to, for example, load up a plane from London to Dubai and then Dubai to Singapore. The airline industry started moving away from that and toward more point-to-point routes in most cases. A 787 lets an airline serve a route that just wouldn't fill a 747 or A380 and provide customers with a better experience. For most airlines, that's a win.
The A380 isn't just a 747 competitor. It's a bet that the 747 didn't go far enough and that what airlines really needed was something huge. Boeing's bet was that a fuel-efficient twin that could serve point-to-point routes (rather than hub-and-spoke) would provide the economics for better, more customer-friendly routes, better utilization due to fewer empty seats, etc. Airbus didn't build a 747 competitor, they wanted to one-up it.
It is true that some airports have constrained slots, but is this mostly a London Heathrow problem? A slot-pair at Heathrow can go for over $50M. By contrast, the DOJ valued 12 slot-pairs at JFK at $44M or $3.7M a piece. American sold 17 at LaGuardia and 52 at Reagan for $381M or $5.5M a piece. That's certainly money, but it seems like the problem at Heathrow is an order of magnitude worse. When you move down from the most congested markets (and DCA kinda counts due to artificial restrictions), slot constraint seems a lot less interesting. Is the A380 a plane to solve the problems of a few airports? Is solving that problem enough?
If you're Emirates, London -> Dubai might be your most important route and the A380 means you can service it for a lot of people. Of course, that's where most of the A380's support is coming from. For airlines that don't operate such a hub-and-spoke model, who use less constrained airports than London Heathrow, etc. it seems that the 787 has been a lot more attractive.
You're right that when they started the A380, it wasn't clear that the market would turn the way it did. Honestly, if Airbus had made a 747 competitor instead of something much larger than a 747, it might have fared better. But the number of routes that can fill an A380 is small, the number of airports where landing slots are unduly expensive is small, and customers like the convenience of point-to-point (and the larger windows, better headroom, better humidity, less noise of a 787).
The A380 isn't a complete bungle, but it was a bet that not only did airlines like the 747, but they wanted something larger. Boeing bet that if they could have something a bit smaller for a lot of the routes the 747 was on, they'd like that. The A380 found a big customer in Emirates, but the 787 has much broader appeal. That doesn't mean the A380 doesn't have utility and is certainly useful for certain routes that are popular and slot-constrained, but the 787 seems to be more useful for a larger number of situations.