My word there's a lot of instant dog behaviour experts on here today!
OP.
Write a statement NOW, to yourself, as to what EXACTLY happened prior to the bite, the bite itself and what happened afterwards.
Take photos of the bite.
Now ask yourself and your partner honestly if you can manage the situation so that this cannot occur again?
If you can do that, then find a reputable behaviourist - APBC, ABTC, COAPE etc.. not some fly by night 'dog whisperer' wannabe, LOOK for professional bodies, those listed above require actual externally verified assessment and are not simply 'pay to join' clubs as sadly many are...
See what they say - if you can manage safely (and after all you have for some time!) and put in the work, great.
If you CANNOT, for whatever reason, then you have investigated all reasonable avenues, and whether you rehome or euthanise, you have done all the right things.
I will say, from your description alone, it does sound as if your dog has inhibited his bite, this reads like a level 2 bite on the Dunbar bite scale (apdt.com/wp-content/uploads/2017/01/ian-dunbar-dog-bite-scale.pdf) which is not in and of itself a reason to immediately euthanise without further investigation.
This also does NOT signify that things cannot be improved, or that either dog or child cannot be kept safe within the same home.
However it does suggest that your dog feels uncomfortable and you have missed some communication or taken your eye off the ball somewhat.
To be clear, your dog COULD have done serious, significant damage.. he did not, not because anyone moved quick enough, not because he made an error, but PURELY because he had NO intention of doing so in the first place. That means there is scope for improvement, your dog is NOT incurable or inherently aggressive.
Please seek expert help and not the advice of keyboard warriors and pearl clutching dog haters on here!