Mark Darrah has clarified the number of endings in Dragon Age: Inquisition

"Most endings are major variations based upon your choices in the game. There are only a few completely unique endings," Twitter.

Therefore it can be assumed that 40 "major" endings does not mean 40 "unique" endings.

Further information can be found here.