In Spain (blocks of three digits) or the US (three digits for the area code, three for the office four for the subscriptor), phone numbers are split into a fixed amount of digits.
However in Switzerland, where I live now, destination codes are mostly three digits, but some cases use four. In the first case, the subscriber has 7 digits and in the second, 6, totalling 10.
Indeed, if you check the links I posted above, in India there are areas distinguished by two digits, and there are others with three digits. And then there are also differences between landlines and mobile numbers.
Last, there can be numbers which don’t make any sense, because they don’t exist and they use no convention.
It makes sense that the separation with hyphens, parentheses or spaces respects that codification. There is a good explanation with plenty of examples at https://en.m.wikipedia.org/wiki/Telephone_numbering_plan. Even further details for you on https://en.m.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbe rs
There is nothing wrong with your device and how and why it stores numbers, even from the same country, with different formatting and block length. But feel free to do your own research.