As inflation surged over the last two years, the Fed and leading private-sector forecasters were persistently behind the curve, seeing it as a temporary phenomenon that would eventually fade.