Right; the setting is just a "wish", there's no guarantee that you'll actually get that many planets. Sometimes it runs out of room to place more planets. Sometimes it thinks it has run out of room even though it actually hasn't. This is just a side-effect of how the generator works, not a bug per se.
You're right about the 'unoccupied' number though - all the home planets are counted towards that number for some reason. So three people start a game of 18 unoccupied planets, and the home planets (3) plus unoccupied number (15) will be in the map.
I'm not seeing this. If I start a random map with size Small, two AI players and 5 unoccupied planets, then I get 8 planets in total (5 unoccupied + 1 for me + 2 for the AI).