Translation:Is there a risk free investment?
As you said, 没有 goes with 风险. 没有风险="does not have risk".
有=There is/There are (something exists)
没有风险=does not have risk
的=(what comes before is describing the next word)
吗？=(The statement becomes a yes/no question.)
So, this sentence is asking if risk-free investments exist, not if risky investments exist.
The first word 有 and the following 没有 have nothing to do with each other. 没有风险="does not have risk". See my comment above to PipuPupi for more details.
I would translate your question "Is there a risk to the investment?" as 这个投资有没有风险? or 这个投资有风险吗? In the translations of your sentence, notice that 投资 is the subject of the sentence, and you do not see 有没有 ocurring in the same sentence as 吗. 有没有 and 吗 both ask yes/no questions, but they don't work together. If you see a sentence (like this exercise) that has 有没有 and 吗, then the 有没有 is not really "有没有” but rather "有" (space) "没有".
这个句子太麻烦了! I admit, I also fell into this trap, not noticing that question particle at the end. It is a really good lesson: pay attention to the details. By the way, I tried it in Google translate: it also got it wrong! So, it is not ambiguous, just tricky. But if you make a statement out of this question, that's when ambiguity comes to the scene: 有没有风险的投资 would mean "there's a risk-free investment", but can it be also a question? Like, "Is there a risky investment?" I wonder, what would our respected native experts say. Alas, no dictionary I checked provides translation for "risk-free". "Risky"? Easy: 有风险. "Risk-free"? Sorry, no such thing. :D
Native here. As others ponined out: 无 is better than 免。无 is closest in meaning as 没有。免 on the other hand, means a little different is used in a slightly different scenario. 无 means no in a "never existed" way. 免 also means no but in a "existed or could have existed, but is preventable, prevented or exampted". For example: 无罪 means not guilty, while 免罪 means crime exempted. 无风险 means no risk to begin with, while 免风险 could be something like, there could be huge risk but because you have "good connections", you are gonna end up being able to get away with it.
I mistook it, too. ;o)
Your question 没有风险的投资有吗？is grammatically correct but would have a slightly different emphasis: "Isn't there a risky investment?"
For "Is there a risky investment?" you could say:
有没有(有)风险的投资？(without the 吗)
For "Is there a risk free investment?" it would be:
It is quite logical, almost mathematical:
"Is there …… ?" is either 有 …… 吗？(with 吗, and that is the case here)
or 有没有 …… ？ (without the 吗, which is not the case here).
So, on the outside, we have 有 …… 吗？= "Is there …… ?"
and on the inside we have 没有风险的投资 = risk free investment (literally: an investement that does not have risks).
有 [ 没有风险的投资 ] 吗？ = "Is there [a risk free investment]?"
And when even mother tongue speakers say that she could have made a longer pause after the first 有, that means we all are not so bad. ;o)