All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
There is no sound evidence from the Sharee’ah that the family of the deceased should do anything on the fortieth day after his death.
What is certain in the Sharee’ah is that the family of the deceased should supplicate for him asking Allah to forgive him and giving alms on his behalf intending that Allah gives him the reward of all these acts.
As for the ceremony some people do forty days after the death of one of theirs, it is pure innovation. Such practice was not done by the Prophet, his Companions, the righteous predecessors, or any other righteous Muslims in the past. So, one should avoid it completely.
Allah knows best.