It’s possible though unlikely to end up with a bad roommate thru random assignment.
However if you room with your friend there may be sources of friction. To start with, even if you’re good friends now they aren’t living with you in your house. In the dorm they are and there may be the assumption (by you or them) that it’s ok to borrow stuff without asking. I’ve seen friendships hit a rough patch over this.
A deeper source is expectations. College is a time to explore broadly, both academics and personas. Maybe your friend has always been a studious person interested in the sciences but in college discovers a love for the liberal arts and starts hanging out with quite different people than your current mutual friends. You may feel betrayed, this isn’t what you thought would happen when you picked a safe roommate. Or it could be you that wants to change but faces pressure to still be the person you are today.
Lastly as you make new friends and start hanging out with them your HS pal may assume they have an automatic invite. But your new friends might not particularly like your roommate. Building new sets of friends, some mutual and some not, can be a tough line to walk for HS roommates. It’s much easier to manage this if your HS pal is a fellow frosh somewhere but not in your dorm room.