For internal engine purposes UnrealHeader tool adds an additional enum entry "EnumName_MAX" to the enum values, hence the runtime version returns different number.
A user reported that UEnum::NumEnums appears to be returning one more than the actual number of elements in the enum.
The number "4" is output in the top left corner of the screen.
The number "3" is output in the top left corner of the screen.
Head over to the existingAnswerHub thread and let us know what's up.