The booster being the same formula does not, in any respect, mean that. There are quite a few vaccines that are given in multiple similar or identical doses and provide stronger and longer lasting protection after the later sides.
My guess (purely a guess) is that the actual problem with the Pfizer vaccine is that the sides are too close together. The Moderna doses are spaced farther apart and (preliminary, unreviewed) results suggest that it works just fine even six months after the second dose.
I would not be at all surprised if a booster dose of either mRNA vaccine after six months gives essentially lifelong protection. I also would not be surprised if it didn’t.