What you observed versus what you expected can be explained!
Your case is a result of how ERPNext stores and manages numeric values: In the case of whole number (or integer) values and real number (of floating point) values, in either case quantity values are apparently all stored as a Python class float.
To confirm this, in the Setup module open a Customize DocType on Item and you will see numeric values Opening Stock Minimum Order Qty and so on are of Float type.
What you happened on is a case of representation error
This function aims to identify such problems validate_uom_is_integer
Here are other references that may help