That ~$5billion per launch includes a lot of amortized R&D and other costs that you are not counting in the 61 successful Falcon launches. It may be that the Falcon launchers are significantly cheaper, but the accounting methods are too different to just compare numbers.
SpaceX's yearly spending would include the 61 flights, but also literally thousands of satellites, presumably a huge number of commercial dishes, their human flight overheads, their Starship development program including ground support and production and testing of about a hundred Raptor engines, their sales and outreach, their specific contract work like HLS, and their mug business by the side.
If you were to amortize SLS's total dev costs (incl. Orion and SLS-specific ground support but excluding Constellation) over its reasonably expected lifetime flights, you'll be lucky as heck to get <$10B/flight, though of course we don't know how that adds up and so report the much smaller marginal numbers instead.
Your right that figure isn’t accounting for the $23.8 billion cost of the program so far. That $5billion per launch figure is based on an optimistic number of SLS launches which haven’t happened yet.
SLS and Orion are dead ends. I wish them well and I am huge space geek but that program is just a gigantic waste. I wish we could take that budget and use it for unmanned missions or public/private space station partnerships with some of the new space companies.
$5B (2023: $4.7B) is actually the current yearly run rate for SLS+Orion+EGS. Thus, $5B is what the marginal launch cost would be if SLS was launching yearly, excluding $54B to-date costs of the three. Even NASA's official projections (which are always optimistic) don't show yearly launches, but if unreasonably optimistic numbers still make the point, why quibble over the details?