I am sitting in one such building right now. We are way closer to the ocean than would be allowed today.
We are “grandfathered”. This means that our building (and the septic system) are allowed to continue to exist where they are. We are permitted to fix whatever goes wrong with the building (such as replacing siding or anything that rots). We are not permitted to make it bigger.
If our septic system were to fail, we would need to build a replacement in a different location. In contrast if our roof were to fail, we could replace it in place with a new roof.
One issue here which I think is very important is that when this building was originally built, at the time it was legal and had whatever permits were required at that time.
Oops. This sounds like something that a local lawyer would be needed for. This might be done on a “case by case” basis and local laws are going to be important.
Are you thinking of purchasing the property, or do you already own it? If you already own it, is anyone trying to get you to make changes?
Is this for a neighbor’s property where they got too close to your property? You might need to decide whether or not to fight this.