I think you're taking the wrong approach with threatening him with grounding.
My 6yo DD had a similar / much worse problem with daytime wetting. We seem finally to have conquered it in the last few months. All through reception she wet herself every day (often twice a day or more) at school and Year 1 wasn't much better.
It seems to have been a combination of things but the root cause was probably low-level constipation over a long period of time when she was a toddler, which caused her brain to block out the full-bladder sensation (because bladder and bowel are very close together and constipation meant the bowel always felt full-isa).
Anyway, it took years, and hard work to sort this out. It is really frustrating as the adult, but all the professional advice I had was that kindness and calmness are really important.
What really kickstarted the cure was seeing a private paediatric urologist (I got a referral from GP). DD was only 4, so NHS wouldn't help, but perhaps they would refer on the NHS for a 7yo. You can look up the NICE guidelines which say clearly that daytime wetting problems should be referred. Taking them with you to the GP is a good idea (I have done this with other conditions to ensure referral).
After a long course of Movicol to clear the constipation, DD had a course of something called 'biofeedback' treatment, which reinstates the link between brain and bladder. It worked well, but after a few months, the wetting started again, so we went back for a few refresher sessions. After those, when she had another relapse, we bought a bedwetting alarm, which clips to her pants and goes off at the first drop of urine. She wore that around the house during the day, and it helped to reinforce the biofeedback treatment.
Now, age 6, she has been dry in the daytime for several months and has had no accidents at all at school so far in Y2 (which feels miraculous and wonderful!)
If you are in the North and want a recommendation re: the biofeedback, you can PM me. You could also google it. You have to be committed to following all the attendant recommendations about quantity and timing of drinks, position on the toilet while wee-ing etc. etc. It is not an instant cure, but it absolutely worked for us. It's not cheap (cost about £2k altogether, including consultant appointments) but for us was well worth it - we did it instead of a holiday, and frankly not having to deal with constant wee accidents any more is better than any one-off holiday!!