A 5 year old kid should be potty trained and out of diapers at least during the day.
That is unless the 5 year old child has health issues that require the 5 year old to need to wear diapers full time.
If the 5 year old child needs to wear diapers in the day or all the time because of autism, mental health issues, incontinence etc then they should wear the diapers.
There's nothing wrong with a 5 year old child or any age child or teen or adult wearing diapers if they need to or want too.
But they should be potty trained.
Some 5 year olds wet the bed including my own kids who wet the bed and they wear diapers for bed wetting.
I have a 5 year old boy and an 8 year old boy who do wear diapers when sleeping because they wet the bed.
The 5 year old and 8 year old wear the Pampers Cruisers diapers and the 8 year old wears the Pampers Cruisers size 7 diapers as they hold a lot of pee.