The inherent difficulty in answering a question such as this is that only you know the precise meaning you were intending to convey with your initial statement. Without hearing the statement first hand we have no notion of any emphasis you may have placed in your utterance. If you stressed the word SHARP, it would suggest you were attributing the problem to be the sharpness of the knife (or rather, the lack of it). Without any stress on the adjective, the logical inference would be that you were commenting on your technique with knives in general regardless of how well-honed the given one might be.
So, if you intention was to state that the experience has taught you HOW to use a knife (sharp or otherwise) properly when cutting a mango, then both statements amount to the same thing as both suggest a better understanding of the technique for dissecting a fruit. By learning how NOT to do it, you also have a better understand of how to do it more effectively, and vice versa.
On the other hand, if you did stress the adjective 'sharp', then your intention could be taken to mean that a knife that is sharp (as opposed to the comparatively blunt one you did in fact use) would have been better. In other words:
That will teach me to use a SHARP knife when cutting up a
mango—instead of a blunt one.
In this case the two statements, given by you and your child respectively, have opposite meanings. Your statement asserts a sharp knife is the way to go, the second, conversely, favours a blunt one.
Here we might infer your child was thinking a blunt knife might be less likely to cut you. This is, of course, a logical fallacy possibly attributable to the child being only 7 years of age. As I suspect you are aware (and thus what I conclude you most likely intended by your statement): the sharper the knife the more precision it affords decreasing the pressure required and, in turn, the likelihood of subsequently cutting into an unwisely positioned digit beneath it.
A better statement altogether might have been to leave the knife out of the equation and address the real issue by saying:
That will teach me to hold the mango more safely when cutting it.