No it doesn’t mean that the prayer is invalid and must be repeated. It means that the reward of the prayer will be significantly reduced, and Allah may not accept the prayer in the sense that it won’t have much value. Otherwise the prayer is still technically valid and does not have to be repeated.