Surely it has happened, that a famous chess problem turned out to be incorrect because some move was overlooked. Maybe a chess engine found out that a classic problem was incorrect! Is there a collection of such problems? Please give an example as well, if you know any.
You can find a list of 8039 cooked, which is the official term that means incorrect, chess problems here on the site Yet Another Chess Problem Database, often shortened to YACPDB. Another option is a list of 28670 problems on the Die Schwalbe Chess Problem Datebase website that can be found by inputting 'COOKED' into the search bar,.
A famous example of an incorrect problem is the below problem which calls for White to play and checkmate Black in 8 moves.
[Title "William Shinkman, St. Louis Globe-Democrat 1885, Mate In 8 Moves"] [FEN "k7/P7/P7/P7/P7/P7/P7/R3K3 w - - 0 1"]
The intended solution was 1. 0-0-0!, White castling queenside, followed by 1... Kxa7 2. Rd8 Kxa6 3. Rd7 Kxa5 4. Rd6 Kxa4 5. Rd5 Kxa3 6. Rd4 Kxa2 7. Rd3 Ka1 8. Ra3#.
But as it turned out, 1. Kd2! also checkmates on the 8th move, thereby making the problem incorrect. An example of a possible continuation is as follows: 1. Kd2 Kxa7 2. Re1 Kxa6 3. Re7 Kxa5 4. Re6 Kxa4 5. Re5 Kxa3 6. Kc3 Kxa2 7. Re1 Ka3 8. Ra1#.
On Tim Krabbe's website, Bader Al-Hajiri published a correction of Shinkman's problem with the White king on g1 that utilizes Chess960 to allow for the long range castling.
[Title "Bader Al-Hajiri, After Shinkman), Tim Krabbe's Wesbite 2007, dedicated to Tim Krabbe, Mate In 8-Chess 960"] [FEN "k7/P7/P7/P7/P7/P7/P7/R5K1 w - - 0 1"]
'Famous' I don't know about. Few problems become famous in any real sense. Problem tourney winners (which should be thoroughly tested) sometimes turn out to be cooked, but that removes their fame, and they're largely forgotten, and so no longer famous.
Rudolf Willmers won 1 pr in American Chess Association tourney 1857 (part of the 1st american congress), but one of the problems in his set was cooked
Samuel Loyd won first prize in the Chess Monthly, 1857 tourney, but his 4# was cooked.
The 'professional's prize' in the Frere Tourney, 1859 (conducted in Frank Leslie's, but seems to have been his own private affair) was won by T. M. Brown, but three(!) of his five problems were later found to be cooked.
The most famous mess is probably that concerning J. Campbell in the 1862 tournament of the British Chess Association. He won the best prize as well as another prize (1st? 2nd?) for best set. After the prize problems were published, the best pr. problem was found to be cooked. That made his set incomplete, and so it had to be cancelled. Another of his problems were given the best prize, ... but it too was found to be faulty. All that after the judges report had been published, and prizes had been handed out!
Of course, more than 150 years since then provides lots of additional opportunities for similar messes.