My croton is about 5 years old and was repotted several months ago when the soil started smelling like rotting soil. I don’t know the species. I may have used a soil that I used for the yard and it had some compost in it. I used a high grade indoor house plant soil this time. It did amazingly well for quite awhile and then one day I noticed that there were tiny black spots mostly on the underside of the leaves. I believe it is spreading when the sides of the leaves rest on other leaves. I wiped down the plant thoroughly with a wet paper towel- the speckles wiped off and left a purplish color on the towel. I have now wiped it down thoroughly twice and it is a lot better but it is still a problem and the leaves are definitely showing stress now.
From your somewhat limited description, I believe the black spots are scale insects. Scales have soft bodies that are covered by a hard protective shell. They don’t move or look like other insects, but they are. Wiping will remove the visible scale insects, but it invariably misses the translucent juveniles that hide in tiny crevices.
Mix a solution of 5 parts water, 1 part rubbing (isopropyl) alcohol and a squirt of liquid dish soap. Then, spray that solution so that all leaf and stem surfaces on your Croton are dripping wet. This is a messy process but it is the only way to get to all of the scale insects. If you are thorough, one treatment is usually successful, but you should be watchful for any future reappearances of the scale.
Insect infestations are often an indicator of other problems because insects thrive on plants that are under stress for other reasons. In your case, I am concerned about the repotting, which should not have been done and was not done properly. Outside garden soil and compost should never be used. And there is no such thing as “high grade indoor plant soil.”
Unnecessary repotting often leads to root rot. I cannot be sure if that is the case with your Croton because I do not have the details of what you did. However, you must be very careful not over water your Croton and make sure it is on a sunny windowsill.