I've read a lot of published novels which were fanfic, but none where I didn't know that's what it was from the beginning.
The only one that's typical modern fanfic was a hockey romance where I'd read a review mentioning that it started as a captain America/Bucky Barnes fanfic. I doubt anyone who only knew the films and comics would recognize the inspiration, though. It had several of the fanfic tropes, but a lot of those have moved pretty far away from the original inspiration. It's quite good. (
Rachel Reid's Game Changer)
The vast majority of published fanfic I've read have been based on works which are no longer under copyright, so they could state it openly: Sherlock Holmes, Jane Austen, Charles Dickens, Georgette Heyer, Prisoner of Zenda, HC Andersen, probably more. I'd also put fairy tale and myth retellings in this category. I enjoy seeing different takes on the same story.