You don't really provide sufficient information, but the gift may be valid, despite the misdescription.
There's a doctrine applied to the interpretation of legal documents (including Wills) "Falsa demonstratio non nocet cum de corpore constat" (A false description does not invalidate a clear document).
This means that if the testator intended to pass something in his Will and a court can determine (with the aid of extrinsic evidence where necessary) what the testator intended, then the fact that the testator misdescribed it in his Will does not prevent the Will taking effect as intended.
So in your own case if the testator had, for example, two nieces called Alison and Barbara Jones, and the Codicil said "I leave £50,000 to each of my granddaughters Alison and Barbara Jones" the gifts would probably be effective, as a court would probably conclude that he had meant to benefit them.
But if he had simply said "I leave £50,000 to each of my granddaughters" the gift would almost certainly be ignored, as a court could not say with any confidence that he had meant to benefit his nieces.
So it depends to a large extent on whether or not it's possible to identify the intended beneficiaries from the Codicil with a high degree of confidence.
The fact that the Codicil was prepared by a solicitor is helpful, in that the Codicil will at least have been properly executed. However, the solicitor should be made aware of the situation, so that (1) the file relating to making the Will can be specifically preserved as evidence in the event of a dispute; and (2) the solicitor can place a signed statement with the Will explaining that (assuming such to be the case) the testator specifically intended to benefit the beneficiaries identified as "granddaughters" even though they aren't his actual granddaughters.