If you're doing the right move, using the right fingering, blowing the right way, aren't too tired etc. you'll be able to play that passage eventually if you allow yourself a few days, weeks or months to learn it. You don't necessarily have to change your playing for every passage that doesn't work immediately!
If you expect perfection right away, you will only create stress for yourself which will slow down your progress.
We've all heard that playing music takes talent and practice but we often forget one element in the equation: time and patience. Progress will happen gradually if you're doing what you have to do on a daily basis. You'll be a bit better than yesterday and tomorrow will be a bit better than today. At the end, all these "a bit better" will add up and it'll be quite good!
The truth is that learning a musical instrument is a long process. It takes years to reach a certain level and once you've reached that level, you'll probably want to be even better! So when should you be happy with your playing?
The answer is: RIGHT NOW!
Not being perfect doesn't mean that you can"t have fun playing. Also being happy with your playing doesn't mean that you don't try to improve. We all know what we have to work on and are doing it but we also have to appreciate what we've achieved so far.