I don't think Joshua was mistaken, I just don't believe that if the Bible references another book or something that the other is inspired like the Word of God. The Bible references Greek gods sometimes and many OT gods and goddesses but that doesn't mean they're holy.
“The prophecy of Balaam son of Beor,
the prophecy of one whose eye sees clearly,
4 the prophecy of one who hears the words of God,
who sees a vision from the Almighty,
who falls prostrate, and whose eyes are opened:
5 “How beautiful are your tents, Jacob,
your dwelling places, Israel!.....
Genesis 15:13 Then the Lord said to him, “Know for certain that for four hundred years your descendants will be strangers in a country not their own and that they will be enslaved and mistreated there.
All the words that had came from God has been written down in a book for the next generations to know; God wanted to let the people to know that He is God, that what ever He says is going to happen, it is going to happen; and if the people doesn't know what he had said, then how will the people know that He speaking the truth? It would be stupid to write a book about a group of people being in captivity for four hundred years after they had came from it; that will not prove nothing. It is like if I prophesied about a man that goes by the name Tintin will come to this site, after he has been on it for a while; that isn't a prophecy, because I said it after the fact, not before. The Hebrews were waiting on the Lord way before Moses had came to be; and so they must kept records and had past it on down to the next. So if the next pharaoh, he did not knew what Joseph had done, but why he didn't know? Everything has to be written down or else it will be forgotten or blotted from our minds.
Hebrews 8:12 For I will forgive their wickedness and will remember their sins no more.”
Matthew 26:75 Then Peter remembered the word Jesus had spoken: “Before the rooster crows, you will disown me three times.” And he went outside and wept bitterly.
John 14:26 But the Advocate, the Holy Spirit, whom the Father will send in my name, will teach you all things and will remind you of everything I have said to you.
Luke 23:42 Then he said, “Jesus, remember me when you come into your kingdom.”
Luke 10:20 However, do not rejoice that the spirits submit to you, but rejoice that your names are written in heaven.”
Proverbs 3:1 My son, do not forget my teaching, but keep my commands in your heart,