AMS finishing a spool and failure to retract

Hello good people !

Recently I started having problems when spool ends. As the last bit of filament passes trough the AMS feeder, system stops tries to retract(which it can’t do, as the filament has already passed the feeder and there is nothing to retract) and displays “failed to retract fillament” error.
Up until now, when spool ended, extruder kept pulling the filament and when the end reached it, then the filament change was initiated. What changed? Why does it have to retract the last centimeters from ams to extruder instead of finishing them ? Why initiate the swap at the AMS sensor and not at the extruder ?
Or am I looking at the whole thing wrong ?
Apart from that scenario, I have no issues with filament changes.
I could not find other threads with this problem, apologies if It has been discussed before.

Welcome to the forum!

Normally the only time there’s a problem with filament runout is if the end is attached to the spool or the end of the filament is crimped in such a way that it can’t go in the first stage feeder. It sounds like your problem might be caused by one of the filament sensors in the path to the hot end isn’t working. Normally I would say there’s a piece of filament stuck but if it’s happened multiple times I’m thinking filament sensor.

You say “recently”.
Was it working fine previously?
If so, did you make any change to the system (printer, AMS, firmware, filament)?
Printer and AMS models?
Does the printer have the hub installed?

Thank you !
Well technically the filament is stuck - yes, because it’s a few milimeters past the ams feeder and the ams is trying to retract it instead of the extruder pulling it untill it’s finished.
If it is the fillament sensors, would it be logical to assume there will also be problems with detecting new spools ?

Thank you !
Yes, recently, as of the past month or so. Last three spools i had to manually pull the filament left in the tubes and and place new ones. For the year before that, it worked just fine.
No hardware change of any kind, same filament. As for firmware I just do the regular bambu studio updates.
P1S combo(AMS 1), no hub

Well that’s a good point. What does the end of the filament you’re using look like? If too much resistance is detected it attempts to retract back to the point it’s right past the first stage feeder…but it can’t because it’s already past that point. Is it always the same filament slot or different each time?