After several attempts, I managed to get the final coin in the castle in World 6. It was where I expected it to be, but I obviously hadn’t tried hard enough. Anyway, that’s World 6 completed now.
Moved on to World 4. Yes, I realise I’m not doing them in order. Got the missing Star Coins in one level, and then unlocked and completed (without one of the coins) another level.