Hi. This translation is valid too.
However saya berharap kuenya enak = Saya berharap kue ini enak.
Kuenya = this cake / that cake / the cake
So, I think, Duolingo wants to teach you that to point out something, you can use, 'ini', 'itu' and '-nya'
In this sentence, using either 'ini', 'itu' or '-nya' is necessary. You can't translate
I hope the cake is good =/= Saya berharap kue enak.
Because, in Indonesia:
Saya berharap kue enak = I am hoping for a good cake.
If you want to point out THAT specific cake, 'ini' or 'itu' or '-nya' is needed.
'-nya' does not only the translation for his/her. As you can see my example above, it can mean something else
According to my Indonesian wife and brother in-law. The translation is correct however it depends on the context.
Without further information, "I hope the cake is good." is correct. If there was extra information about a second person it could be "I hope her / his / your cake is good."
Kinda confusing with nya meaning it belongs to someone. I just imagine i'm at a birthday party talking about the homemade cake someone made. Thats a context that makes sense at least.
Excerpt from "Indonesian: A Comprehensive Grammar":
It can also occur attached to the head noun, being translated 'the' . This can occur where the noun has not before been mentioned but is understood within the context of the utterance. Where a thing or person has recently been mentioned itu must be used in the repetition. The different distributions of itu and -nya are shown by the following sentences:
Ibu sudah memasak nasi. Nasi itu di lemari.
Mother has cooked rice. It is in the pantry, (literally: That rice is in the pantry.)
Kalau mau makan, nasinya di lemari.
If you want to eat, the rice is in the pantry.