If the target land is an illegal target when Sandworm's last ability tries to resolve, it won't resolve and none of its effects will happen. The target land's controller won't search for a basic land card.