I came across this story the other day about a gift left to charity that ended up in the wrong place. Basically, the donation was accidentally sent to the wrong animal shelter; both had the same name, but were in identically named cities in different states.
In this particular situation, the money had to be given to the correct shelter; you can’t keep money you received by mistake, even if you are a charity. If, on the other hand, the situation had been that the other shelter no longer existed, the money could have been given to this shelter as a similar organization.
If you are leaving money to charity, it is very important to make sure that you have checked the name of the charity, but it is also important to allow for your executor to give money to a general charitable purpose in case that charity no longer exists or has changed its name.