There are times when we write when the doubt creeps in. What you have to remember is that you aren’t the only one feeling like you don’t know what you’re doing with your character/plot/ending. Just keep working, write even though it may not be your best, the true answer will come to you. You are the creator of your story’s universe, you can do this!
Thanks for the encouragement! Time to persevere on my SF YA novel. I’ve done a lot of worldbuilding and planning. I just need to move beyond the 1st few pages I’ve written.