The 40 days is an interim period. When the Hebrews exited Egypt they spent 40 years In the desert before entering the promised land. After His death and ressurection Jesus shown himself for 40 days before ascending into heaven. The 40 days can even be seen as preparatory for a new chapter. After His baptism but before Christ began his ministry he went into the desert and fasted for 40 days. Likewise in Lent we prepare and anticipate the Pascha. Orthodoxy there are 3rd, 9th and 40th day memorials of mourning remembering the deceased.
There are some non-doctrinal pious opinions but not necessarily endorsed by the Church. Such as the soul may linger and visit places and even console the living members. That the ascent to heaven is roughly 40 days etc. But these are opinions not official teaching.