No, because the grappled creature is not removed from the reach of the grappler or grappling effect.
AncientSwordRage predicates their answer on an assertion made in the second to last paragraph of their answer. This assertion, that moving the grappler or grappling effect in such a manner that the grappled creature would be outside the reach of the grappler or grappling effect is equivalent to removing the grappled creature from the reach of the grappler or grappling effect, is not supported by the text or by the precedent set in the Sage Advice Compendium.
First, let's examine the rule in question:
The condition also ends if an effect removes the grappled creature from the reach of the grappler or grappling effect, such as when a creature is hurled away by the thunderwave spell.
The rule states that the condition ends when an effect removes the grappled creature from the reach of the grappler or grappling effect. It doesn't say when either the grappled creature or the grappler or grappling effect are removed. It does not mention the movement of the grappler or grappling effect at all.
The logical interpretation would thus be that the movement of the grappler or grappling effect does not cause the grappled condition to end, since the rule does not say that it does.
AncientSwordRage bases their alternate interpretation on the example sentence that "in the same way that you can remove someone from danger by eliminating the danger instead of actually moving them". I challenge the veracity of the sentence. If you eliminate the danger, the person is no longer "in danger", but you at no point removed them from the danger. You removed the danger. To demonstrate this, imagine a Bard standing in a pool of water. If your pick the Bard up and put them on the ground next to the pool of water, you have removed the Bard from the water. If you cast Create or Destroy Water and destroy the water, sure, the Bard is not in the water anymore, but at no point was the Bard ever removed from the water, the water was removed from the Bard.
This natural language argument is, I'll admit, not rock solid and some would continue to interpret that it doesn't matter whether the grappled creature or the grappler or grappling effect is the one that moves. People certainly had differing opinions on whether an area of effect moving into a creature constituted a creature moving into the area, and until the Sage Advice Compendium clarified that language, it remained open to intepretation.
Luckily, this Sage Advice Compendium enrty on area effects offers a precedent that it does matter which half of an interaction does the moving.
From the Sage Advice Compendium(pp.19-20):
Some spells and other game features create an area of effect that does something when a creature enters that area for the first time on a turn or when a creature starts its turn in that area. Reading the description of any of those spells, you might wonder whether a creature is considered to be entering the spell’s area of effect if the area is created on the creature’s space. And if the area of effect can be moved—as the beam of moonbeam can—does moving it into a creature’s space count as the creature entering the area? Our design intent for such spells is this: a creature enters the area of effect when the creature passes into it. Creating the area of effect on the creature or moving it onto the creature doesn’t count.
Because we now know that it matters whether a creature moves into an effect or the effect moves onto the creature, we can extrapolate that natural language arguments that moving one side of the interaction is equivalent to moving the other half defy this precedent. In the absence of other evidences, the examination of the text of both the grappled condition and the Sage Advice Compendium would indicate it does matter, and that the grappled condition ends only when the grappled creature is removed from the reach of the grappler or grappling effect and is not ended when the grappler or grappling effect is moved.
So, what happens when I shove the crocodile?
When you shove the crocodile, you use the "Shoving a Creature" rules:
Instead of making an attack roll, you make a Strength (Athletics) check contested by the target’s Strength (Athletics) or Dexterity (Acrobatics) check (the target chooses the ability to use). If you win the contest, you either knock the target prone or push it 5 feet away from you.
Assuming you succeed in the contest and choose to push the creature 5 feet away from you, the creature moves 5 feet away from you. Whatever that direction is, the grappled creature will never be removed from the reach of the grappler or grappling effect because the grappled creature is not the one moving. Therefore, the grappled condition does not end.
Since the grappled condition does not end, when the crocodile moves 5 feet, the "Moving a Grappled Creature" rules apply:
When you move, you can drag or carry the grappled creature with you, but your speed is halved, unless the creature is two or more sizes smaller than you.
The crocodile thus drag the grappled creature with it. Speed does not affect the distance a creature moves when it is shoved, so the crocodile is pushed 5 feet away from you grappled creature is dragged or carried with it.
A list of things you can do to remove the grappled creature from the reach of the grappler or grappling effect and thereby end the grappled condition:
- shove the grappled creature into a space that is not within the reach of the grappler or grappling effect
- grapple the grappled creature and use the "Moving a Grappled Creature" rules to move the grappled creature to a space that is not within the reach of the grappler or grappling effect.
-using a spell or other ability that moves the grappled creature to move it into a space that is not within the reach of the grappler or grappling effect, examples include dimension door, thunderwave, or eldritch blast with the Repelling Blast invocation.
The first two options will almost certainly be easier to pull off anyway, considering the grappled creature in your example likely has a much lower Athletics or Acrobatics than that of the Crocodile, otherwise you wouldn't feel you need to save them. This means shoving or grappling the grappled creature would be easier than shoving the crocodile.