"I'm not sure what the right way is"
Everybody learns that What is the right way? is a Wh-Question structure. Add the intonation (which is what the question mark is for), and the context, and it's ordinary. As a question. It's formed from something like The right way is X, where the unknown X becomes what.
But as the Object Complement of a mental or communicational predicate, like know, be sure, or say, it's embedded in the sentence, rather than being the sentence. That makes it an Embedded Question (aka Headless Relative or Wh-Clause), and that's a standard complement type, with slightly different syntax from ordinary questions.
The slight difference is that the normal Question-Formation rule inverts the Subject and the first auxiliary verb
[with two caveant:
- be is always an auxiliary verb
- if there isn't an auxiliary verb, invoke Do-Support]
while an Embedded Question normally does not invert.
- Where are they? ~ I'm not sure where they are.
But, just in case the sentence is intended by the speaker to request information (rather than to merely comment on one's mental deficiency), one way of many that this indirect request can be signalled as a question is to use the other question structure, the one that actually resembles a question, with inversion, instead of without inversion.
- I'm not sure where are they. (means "Where are they?")
This is frequently intoned like a question instead of a statement, and punctuated with ? to mark this.
And that has become a very widespread pragmatic convention in the last 40 years or so, though it still varies locally and socially. And that's all, really. Both are correct, though they don't mean the same thing, pragmatically.