Look into boxabl or some of the other companies putting out ADUs and tiny houses. Unless you are building something that requires massive infrastructure to get water/sewer/electric out to there is absolutely no reason it should cost $300k.
First, though, check your local city/county/state laws...