The answer to this question will depend on how the law prohibiting bitcoin is written. But in general, in cases where the government declares bitcoin illegal, they will punish the person who used bitcoin to buy the house and they will also punish the person who accepted bitcoin as a means of payment for the house they were selling. And the government will seize the bitcoin and the house will also be seized if the person who received the bitcoins used the bitcoin. For example, if each house cost 9 bitcoins and the person did not use the 9 bitcoins, then the government will only seize the 9 bitcoins and will not seize the house.
Your example is excellent.
Here we were talking about the issue of purchase-sale documents. but I want to add here that when people are getting involved in shady transactions, they don't use this method, they accept to be transferred the bitcoin and then make a document in which they are donating the house, in this case the person who paid in bitcoin appears to be just a beneficiary of the donation of the house and the government doesn't know that the house was paid for in bitcoin
When government marks Bitcoin is illegal as a mean for any trade, like house trade and other trades, if you and your trade partner try to invade it by using bitcoin as a mean for the trade, risk rises from here.
Everything will be smooth if the trade is done without any problem from you or your trade partner. If the trade goes bad, with one of trade participants do things like scam, another trade participant will have big trouble. If he brings this trade to police, what police will do. Arrest the scammer if possible, forces him to refund money to the victim; but what will happen with the scammer?
I believe that bitcoin of the scammer will be seized.