It seems that the sound change came first and then the grammatical reanalysis. This is a process called grammaticalization

Jheem, doesn't grammaticalisation refer to only a change in the *meaning of a word, specifically when, it transforms in from something concrete and tangible to one with mere grammatical connotations? I am trying to think of an example, but am struggling with one.
I imagined that the word doesn't morph in either spelling or pronunciation, its meaning however undergoes a specific change.