If the vertices immediately before and after the ones that are within the polygon are coincident, the solution could be running the Processing > Vector geometry > Fix geometriesFix geometries tool from the processing toolboxProcessing Toolbox (Ctrl+Alt+T).