I've worked for different carriers and sold many different phones. I'd say you run this risk with every single smart phone released. Only feature/basic phones are pretty much glitch free initially.
I would definitely ask your carrier about their warranty replacement plan. For example, I've been in a situation where a customer picks up a new phone, uses it for say 35 days, it has a glitch, and then can only get a used replacement under warranty since it's beyond the 30 day in-store guarantee. It's really up to the carrier. So be careful in that regard.
Otherwise, it's sorta play at your own risk. Samsung seems to be pretty reliable though.