The bug
Like most breedable mobs, baby mobs follow their adults. However this is not the case for hoglins, despite being a breedable hostile pig/boar-like mob.
This behavior however exist in bedrock edition.
To reproduce
Spawn an adult and baby hoglin
Observe them as they start to aimlessly wander off
→ ❌ The adult hoglin then wanders aimlessly, while the hoglin piglet does not follow the adult and then simply wanders away.
Confirmed, though it's probably intentional on Java.
Also note that baby rabbits don't follow adults (MC-158608)