Good evening,
don’t be mad at me, but you seem to have approached the topic of house construction very naively, otherwise you would hardly ask whether "all this is legal."
Now tens of thousands of € in costs for earthworks are coming our way. Of course, the poor soil quality was not known before the purchase.
Be glad despite all the frustration over the additional foundation costs that the geologist did not encounter clay. This costs a bit more at the landfill than the material on your property.
Every builder first buys a plot of land according to the motto "bought as seen"; the notarial contract exclusively excludes fraudulent misrepresentation from this procedure. You could have had a soil survey done "before" the final purchase. If you had decided against the purchase based on the results, you would have been stuck with the cost of the soil survey or perhaps could have sold it to a later buyer.
We are building without a basement!
In your case, a basement probably won’t help you either in my opinion; it will only get more expensive because the measured groundwater level is probably too high and another sealing of the basement would have had to be done.
Rhenish greetings