Preliminary matters
For sake of argument, it makes sense to assume in this answer that there is no liability insurance in place for the house. In real life, the Property Manager would have put property insurance in place and might face liability for not doing so. But this reality distracts from the real basic legal question being asked about insolvent decedents. I still feel compelled to mention, however, that real life would be more complicated.
Also, the word "decedent" means someone who has died.
The question and its answer in Poland
Can the heir say “oops, I’m not interested in this house anymore - the
Court can take it”? Or, can the Court demand that the heir pay for all
the damages and/or go to jail?
Within a time frame set in Polish law (I don't know precisely what that deadline is, but it is fairly short, you can't wait for years and years), an heir can disavow any right to inherit anything from the decedent, and escape any legal responsibility for the debts of the decedent. This is done to avoid "universal succession" which is the default choice if no official action is taken. If there is not a timely opt out from "universal succession", then all assets of the decedent, and all liabilities of the decedent, are assumed collectively by the decedent's heirs.
The American legal English word for doing this is called a "disclaimer", but I don't know how the word for the closely analogous act in Polish law is usually translated into English. I also don't know precisely which documents must be filed with whom to disclaim an inheritance under Polish law.
The heirs are very unlikely to go to jail with these facts
Criminal charges that would cause someone to go to jail would be very unlikely in this case since the heir didn't even legally have authority over the property when the deaths happened. For criminal charges to be imposed, it is almost always necessary for the criminal defendant to personally engage in some action or inaction that the criminal defendant could have done differently if they were obeying the law.
You can't be sent to jail just because your dead father engaged in criminal negligence, if you couldn't have corrected his culpable actions before the harm occurred.
In non-Polish civil law legal systems
Poland has a civil law legal system.
This general scheme would apply in essentially all other countries with civil law legal systems which includes most countries in Continental Europe, most countries in Latin America, and most countries in Southeast Asia and East Asia.
Of course, the exact deadlines, officials involved, and terminology, might vary from country to country.
In common law legal systems
In common law legal systems, like the U.S., England, Australia, and New Zealand, the heirs don't have any liability for the wrongdoing of the person from whom they inherit unless they formally assume liability for that wrongdoing.
Instead, in common law legal systems, the heirs don't get any inheritances from the decedent until someone files a probate case in the appropriate court and is appointed as executor of the estate by the court (sometimes called a "personal representative" or "administrator" of the decedent's estate), and all outstanding debts, liability, and obligations of the decedent are settled from the property that the decedent owned at the time of the decedent's death. If the debts and liabilities exceed the value of the property in the estate, then the executor never distributes inheritances to anyone.
There is never a risk that an heir will be exposed to the liabilities of the decedent through inaction (from any assets other than a possible inheritance) in the common law legal system.