Please have a look at the following sentences:
Lustlos suchte ich der Oma ihre Brille.
Lustlos gab ich der Oma ihre Brille.
der Oma dative case and
ihre Brille accusative case in both sentences - or are there differences?
The possessive as in your example, however is indeed a dative constuction.
In your second example,
In this sentence
This sentence is completely grammatical, although is has a completely different meaning: It cannot be the glasses of
This test will fail with your other example:
You can try another test by substituing der Oma ihre by the article
You see that there are two completely different syntactic structures behind both sentences, therefore they are not the same case, strictly spoken.