When a town changes definition, AKA from size 6 to 7, or 12 to 13, the 7th and 13th stage doesn't start with 50% of your food ready-filled, you start these stages of growth without a granary... even if you have a granary.
I agree that that the player doesn't get 50%, but if I recall correctly, the granary still gives the player an effect from the granary.
If you change size from 6 to 7, you get the effect of what granaries give you for 6 or less population. You get 10 food put into the box. But, the total food for growth changes to 40 food, so you only have 10 food in the box instead of 20 food in the box like when a city grows from size 7 to 8.
Checking:
Notice that it's 925 BC in the next save, with 10 food in the box:
So, the granary still keeps food in the box, but the box doubles in size. Thus turn-wise for producing settlers or workers, the granary doesn't have as great of an impact when a city grows from size 6 to 7 (unless a settler or worker gets produced, forcing city size back below size 7) as it does when a city grows up to and including size 6.
I would guess that a granary works similarly when growing from size 12 to 13.
The granary keeps half of the food in the box that it had at the previous size. But, the box changes from 40 total food to 60 total food iirc. I checked on a save of Takeo's from the HoF and that test confirms that changing from size 12 to 13 keeps 20 food in the box while total food needed to grow from size 13 to 14 is 60 food.
Also, note in the first image above, that below 'granary' it suggests a certain amount of food that will get retained with a line, and on growth from size 6 to 7 exactly that amount got retained per the second image. Again, it was only that the size of the food box to grow to the next size changed.
So, we don't have evidence of granaries failing to work for changing sizes. Instead, we just have the food box changing, and the turn nature of game making it so that granaries aren't as powerful when cities change from size 6 to 7 or from size 12 to 13 as at other times.