As per your snap you have selected different IP address type in rule ,that why your rules are created successfully .
For a brief information on this you can refer this link :
According to what i know is that, it is the default behavior of Security group.
If one or more rule specify the same port ,AWS will apply only most permissive rule for action.
If you specify the same port number for more rules with same IP type(IPv4 or IPv6),
You will be getting error as "the same permission must not appear multiple times".