That carpet lip is designed to lay on the main floor and cover the gap underneath. Looks like it may be dragging a bit more than necessary and getting tucked under it as the slide moves in? You may be able to adjust the slide tilt angle a tiny bit to raise the front edge more as it retracts. That's not technically difficult if its a rack & pinion slide mechanism, but some mechanical experience is helpful to identify which adjustment nuts to turn and how far. You can screw it up rather badly if not careful.
How about trying something simple first, i.e. wax the floor? If the carpet slips easily across the vinyl plank, it won't tuck under anymore.