Hey!
I have read somewhere that it depends on the sims in the neighbourhood. One of my save's kept having girls and what I needed was a boy because I have MCCC where family names only carry on through male line.
I finally got twin boys but it was after like 5 girls :( and I never intended on having that many children for that sim! Both she and I were sick of pregnancies by the end of those boys! But also having said that with the cheats eg strawberries/carrots/music, I tried that too and it didn't work, I still had another girl! So I truly believe it depends on what is in the neighbourhood.