The stabilized spike used in several of the vaccines appears to offer better resistance to new infection than convalescent immunity.
(The theory is that the vaccine antibodies do a better job of binding to the active site on infectious virus particles than the antibodies induced from infection, which bind to whichever part of the virus, and may bind to the form the active site takes after attaching to a cell, rather than prior)
Also, getting the vaccine as early as it is available is a better way to avoid long Covid than getting the vaccine after you've had a course of infection.