Is it JUST to punish someone for something they are UNABLE to do?

-2 month old who wets his diaper
-4 year old who can't do geometry
-epileptic having a seizure

Is there any INABILITY that justly deserves PUNISHMENT?