No you're mistaken.
National portrait gallery has an entrance fee and so do parts of the Royal Museums Greenwich. Both in top 20 on the list.
That’s also true of many of the "free" museums in London, when I went to the Science museum in 2019 there were at least 3 or 4 exhibits that had an additional cost (between £3 and £6 each from memory), then there is money made in the gift shop, cafes and restaurants and additional novelties like coin press machines, commerative coin vending machines and photos taken by staff.
I went to the Natural history museum last month and there was an exhibit to see the creatures from fantastic beasts. I didn't go in but can remember adult tickets are £22.
And we haven't even got to the tourist money spent in hospitality and retail in the area around the Museums in South Kensington.
I may be mistaken by saying paid attractions. What I was alluding to was official visits, I.e having a ticket or passing through a door.
There is no way 579,000 people visited Buckingham Palace in a year according to that list. For the majority of people, having a picture outside is visiting.
There is no way of officially knowing but I would bet if they did that Buckingham Palace would be the most visited tourist attraction in Europe.
As London is the most visited, if you visit London you go and see where the queen lives (even though she doesn’t live there) if you are outside or passing in a car or open top bus.