When does an economist recognize inflation (CPI)

I’ve always wondered… and want a real economist to tell me the answer.  I am about to head to Vegas and have a burger, fries and shake at Shake Shack.  For \$18.   At the same day, no doubt, the BLS will release some nutty data that inflation measured at the CPI level grew only by 2% this year.  The McDonalds hamburger, fries and shake that I bought in ~2010 (for \$5) to the \$18 Shake Shack equivalent is clearly not 2% each year, its more like 20% each year.

OK, So I get that an economist would see the Shake Shack burger and the McDonald’s burger as different items, so inflation would not apply.  This got me to thinking — how would an economist view this logic:

Baseline: In a 1 town global economy with 100 people and 1 restaurant (a McDonalds).  They sell a quarter pound burger for \$1.00. All 100 residents eat one of these burgers every year.   Year 1 CPI=100, which also equals the GDP.

At the beginning of year 2 this hypothetical economy gets a new restaurant – a Shake Shack.  It charges \$2.00 for a quarter pound burger. However, they have no sales for the year. All 100 people still eat one burger at McDonalds every year. Year 2 CPI = 100, GDP=100.  <- no inflation in this economy.

During year 3, ten people switch eating their annual hamburger from McD to Shake Shack. GDP = 110 (90 from McD, 20 from SS).  However, CPI = 100, since the burger at SS is considered a “different product” or has “productivity gains” or some other such garbage.  After all, if they were interchangeable products no rational consumer would pay \$2 for something they could get for \$1 down the street <- no inflation in this economy.

Year 4, all people stop eating at McD and eat at SS.  GDP = 200.  CPI remains at 100, since in theory, these 100 consumers could have eaten at McD. <-still no inflation in this economy

Year 5, the McDonalds closes down. GDP=200, CPI=100.  Even though people are still eating a burger, that is now twice as expensive, and there are no other options, there is still no inflation since theoretically someone could open a McD?  <–?

Year 6, McDonalds corporate buys out Shake Shack in a hostile takeover. They remodel the Shake Shack restaurant, bringing back all McDonalds decorations and “classic” recipes for the burger.   However, they keep the price at \$2 each.  GDP=200, CPI =100.

Note that in year 6 you have the exact same conditions as year 1, same product, 2x as expensive, however there has been no inflation at all in this scenario.

How would an economist react to this line of thought?