Hi! Seems that when you enter a custom format like 0000, the Format Cells window wrongly jumps to Special and even flips the language.. It may also swap your mask to “Social Security Number” or 00000. Your data isn’t harmed, this is just the formatting dialog getting confused.
Try to type a locale-locked custom format such as [$-en-US]0000 so Excel won’t switch categories, or use a formula like =TEXT(A1,"0000"). If you still see odd behavior, update Excel and, if needed, reset Excel preferences. Please also send Help > Feedback with your build number.