Can anyone please point me to any sources for the latter?
TIA
There isn't really any halachic source that it is assur. It is more of a minhag that some have not to.
The concept comes from Hanistaros Lahashem elokeinu vehaniglos lanu ulvaneinu and there's a medrash (or something like that) on that possuk that says that the gender of an unborn child is one of the things that the passuk is referring to. Although it can be argued that with the technology nowadays the gender of your child is known to man (and probably documented in the docs files) so while thousands of years ago it was something only known to Hashem , nowadays that has changed. Alternatively one can say based on the medrash that this is something that man is not supposed to know and we shouldn't use technology to circumvent that.
Another concept is from ain habracha metzuaya eleh bedavar hatzamoy min hayin.
Additionally, since it's an ayin harah to buy things for an unborn baby, once you know the gender you are more likely to start buying things than if you don't know.
Rav Shmuel Mayer Katz (Posek in Lakwood) has a kuntres on hilchos pregnancy/childbirth. In it he says that while Halachickly it's muttar, he recommends against it for the following reason. Say the father really wants a boy. If he finds out in the 5th month that it's a girl, he may have (at least subconscious) feelings of disappointment. If however he doesn't find out until the moment of birth, at that point he is so excited about the new baby and all that he won't be as focused on the gender because he is so happy that he had a healthy baby etc... and that will lessen his disappointment.
All that being said, in more yeshivish circles it's looked at as one of those things that you just don't do and in less yeshivish circles it's more of a regular decision (the same way many non-jews don't want to find out because they want to be surprised) where some do and some don't.