The thing with Pearsall is that the Niners aren't in cap hell yet. They can sign Aiyuk and take one more shot with the roster as is. Then next year they have to make some hard decisions. So if Deebo is traded next off-season, you have a guy who is hopefully talented enough to step up alongside Aiyuk in Pearsall, and he'll have a year of experience in the offense at that point.
Deebo was also a much more important player for the Niners (a) before the league caught up to the team using him as a running option, (b) before CMC arrived to take a lot of those touches he was getting as a "Wide Back" and (c) when Jimmy G was the QB and working much more of the intermediate middle of the field.
Samuel is amazing with the ball in his hands, but he's still not a polished route runner who routinely wins and gets open - Aiyuk does. That's much more valuable now with Purdy behind center.