"...anthropomorphising something which is an innate instinct"
Well, what IS instinct? We tend to use it as a collective way of saying "This animal shows that behaviour and we have no real idea of how that happens, except that it seems to be inbuilt". And if it's inbuilt behaviour that means there is a mostly genetic component to it.
The twist here is that while 30+ years ago it used to be thought that genetics were mostly fixed, now we know that certain memories / experiences can be genetically encoded and even passed on to offspring. So it's not unreasonable to surmise that a some memory / experience is coded as genetic change, which can survive the metamorphic process.
Of course all that is highly speculative on my part and I am in no way an expert on any of this stuff... and of course, yes, they could be anthropomorphising