A 12 year old should wear diapers if they need to wear the diapers.
Diapers are mostly worn by babies, toddlers etc that are not potty trained but even older kids such as 8 to 12 year olds or older may need to wear diapers because even older kids including 12 year olds may suffer from urinary incontinence.
Or the 12 year old may have a bed wetting problem and diapers can certainly help with that.
Wearing a diaper is much better than having wet pants or a wet bed from bed wetting.
If the 12 year old needs to wear diapers then yes they should wear diapers.
Diapers are made for all ages and diapers come in all sizes.
There's no age limit for wearing diapers and if you need them then you need to wear the diapers.