Quite simply, the alleged “answer” isn’t the answer. The first sentence is in the active voice, and the second is in the passive voice (well, part of it is), so that much is fine, but they don’t mean the same thing. Adding “she knew” to the sentence changes its meaning.
The correct “passive voice form” of the first sentence would be
When the girl said she had seen a kangaroo, she was not taken seriously.
Actually, though, only the second half of the sentence, “she was not taken seriously,” is in the passive voice. Changing the first half of the sentence into the passive voice is possible—but extremely awkward, and would never be used by native English speakers. In fact, since we have her reporting a statement, both could be converted to passive voice if you were really determined.
For (absurd) examples:
When “I have seen a kangaroo” was said by the girl,
Now the first clause is also passive voice, though the reported statement is still active.
When “a kangaroo was seen by me” was said by the girl,
Now the first clause is passive, and so is the statement that the girl said.
I must emphasize that if anyone told me “a kangaroo was seen by me,” I might very well not take them seriously either. It’s an absurd formulation.
Anyway, point is, “she knew” has nothing to do with the transformation to the passive voice. Actually, for that matter, “she knew” is in the active voice—to become passive, you would have to do something like “X was known by her,” which again is just going to sound silly.
Any of these “overly-passive” constructions would make someone sound foreign, translating constructions that are perfectly normal in their own language directly into English, which would not use them. In fact, doing this exact thing has been used by authors to emphasize that speakers are foreign: in Game of Thrones, the Dothraki people, who have their own language, are known for saying “It is known.” This is a passive construction, where a native English speaker might have said “Everyone knows that!” or similar. The passive voice here sounds foreign, formal, and solemn—which is pretty much exactly the sense George R. R. Martin wanted to give the statement.
For the record, the matching active voice form of the second sentence in the question would be
The girl knew people did not take her seriously when she said she had seen a kangaroo.
All of the verbs in this sentence are in the active voice. Notice it does not match the meaning of the original sentence.