After posting the thread here, I was searching on Google to solve the issue and found some useful guides like this one. From here, I followed some methods. First I updated the gaming service and reset the Microsoft store. After doing the methods perfectly, I tried to download the game and then installed it and I did not get any error code like that.
Anyway, I am glad that I have resolved the issue and my son and I both are enjoying playing the game together.