Rashbam finds something prophetic in this passage: Joseph died in Egypt but was sure his brothers would keep their promise to take his remains back to Canaan, and this would require a coffin. It took many years, but eventually “Moses took the bones of Joseph with him” (Ex. 13:19).
According to Ibn Ezra it was “the” coffin because it was prepared by Joseph in advance.
In modern times we do not usually prepare our own coffins, but we do give thought to our own funeral arrangements.
It is true that even a gosses, a dying person, is k’chai l’chol d’varav, “alive in every respect”, and one should not begin to arrange the funeral before a death has occurred.
But this does not prevent a person from thinking over his or her wishes in advance and making them known to family and friends. I have even known cases where someone wrote their own hesped – even their own obituary.
If anyone should say, “But people are bound to be biased in what they say about themselves,” the answer might be to quote a rabbinic saying that everyone has three names, the name their parents give them, the name the world calls them, and the name by which they call themselves.