Is there a problem that two different users (with two different phone
numbers) will get the same generated 4 digits code?
It is not a matter of how many numbers we can generate from 4 or 6 digits (because, regarding the number of population, the number of combinations we can do with 4 or 6 digits is not significant and does not make a difference). Also, even with 4 digits PINs, lot of combination are rarely used:
Studies proved that a four digit number is easy for the human brain to remember. It was such studies that helped banks to decide on the number of digits that must be used when you pay with your credit card in a shop. Given this information, you may guess that if you type your PIN code in front of an attacker who has been observing you, he/she could easily remember the movements of your fingers (or see clearly where you typed) which thing can not be done with a 6 digits number.