Look in our Finke-Hallmann-book, and you will see that is a quite normal behaviour that males guarding a nest or larvae spawn again whilst the older larvae are still in the nest.
You can try to leave the old fish. We have often seen young develop in the same tank as the old are living in; I has cases where I caught about fifte or sixty young out of a ten liter tank some months later, and the parents have neever been removed. It’s clear that the following generations had no chance, but not since the parents ate them, but there older brothers and sisters.
But there is no guarantee for this. There are pairs or single males or females which eat their young. One never knows. But if you have many leaves on the ground, javamoss, other structures and a good layer of swimming plants, there is a great chance for at least some young to survive.
You must test it out with any new pair. If it happens to tolerate their young, it’s the easiest way of producing offspring.