Where did your friend get the bike and how much did it cost? I assume it was a Big-Box store and around $50. This is not unusual given the cost and quality of those BSO bikes. The cost of adequate quality control would be considered prohibitive. When my kids were little we bought their bikes at a Trek dealer (it could have been Cannondale, Giant, Specialized, etc. but the idea is the same) and paid a good deal more but got vastly better bikes.
So many parents, particularly those who don't ride themselves, consider kids' bikes as disposable toys and pay as little as possible and the results are what you found.