A few years ago, my family relocated from the Midwest to the East Coast for an incredible job opportunity. We knew going in that we would be facing a higher cost of living, but a snafu with our children's schools turned our move into an absolute financial disaster for us.

Fortunately, it's a disaster you can largely avoid with both a little bit of better planning and recent changes in the law regarding 529 educational savings accounts.

Man looking at wallet while money flies out of it.

Image Source: Getty Images.

What happened?

When we were house hunting for our move, we found a town close to the office with a great school, and chose our home in that town. What we didn't realize until after we bought the house was that it wasn't actually zoned for that particular school. It turns out that the town -- despite having only around 34,000 residents -- actually had multiple school systems, and needless to say our home was outside the high-performing district.

Although we did send our kids to our zoned public school, we quickly realized the education offered was not at the level to which we had previously become accustomed. So we searched for an alternative. Fortunately, there was an academically strong Catholic school in the same town that was willing to accept our kids as transfer students. Unfortunately, the school's tuition was nearly $10,000 per student per year. By the time we were "all in," we had four children there.

To make matters worse, we had almost completely drained our taxable savings for the down payment on the house. While we had been decent investors, nearly all our investments were in qualified retirement plans, which we couldn't easily tap without stiff taxes and penalties. It was an asset allocation choice that seemed to make sense at the time we made it, but that came back to burn us when we needed access to our money well before retirement age.

Add that plus the tuition and the generally higher cost of living we were facing, and we were in a serious financial crunch. It was one for which we didn't have a perfect solution, but we did figure out a way to "make do" -- albeit less than optimally.

Our workaround -- and why it was a mistake

Hammer breaking a piggy bank.

Image Source: Getty Images.

In order to ensure our kids had decent educations, I stopped contributing to my 401(k). In addition, I took dividends from my employer's stock held in my retirement plan as cash distributions instead of reinvesting them. Those dividends were treated as ESOP dividends, which allowed them to avoid the 10% penalty on early withdrawals from a retirement plan. Between those cash flow boosts, some help from family, and a scholarship from the school, we were able to get tuitions covered.

Unfortunately, while the workaround worked, it was incredibly inefficient from a tax perspective. By stopping contributions to my 401(k), I lost the tax deduction on that money, making it immediately taxable at our marginal income tax rate. Similarly, although taking those ESOP dividends as cash allowed me to get money from my retirement account without facing a 10% penalty, those dividends were not qualified dividends. That meant they were also immediately taxable at our marginal income tax rate.

As if that weren't enough, all that extra "income" was affected by phase-out ranges for key tax credits and deductions, making the net tax impact even worse. The net impact meant that our workaround was a horrendously inefficient way to get our kids' tuition covered from a tax perspective, in addition to setting us back a few years from a retirement planning perspective.

How you can avoid that mess

Scissors cutting through the word Tax.

Image Source: Getty Images.

Fortunately, there are now more tools available to parents who find themselves in a similar situation. Thanks to the Tax Cuts and Jobs Act, private elementary and secondary school tuition became an eligible expense for using 529 accounts beginning in 2018. Had that provision been in place when we were facing those surprise tuition bills, we could have used the 529 accounts we had been saving for our kids' college educations to help cover those costs.

While that would have put our savings for their college expenses a bit further behind where they already were, it would have been a far more tax-efficient solution. In addition, the reality is that funding for college is a lot more flexible than funding for education for younger grades -- or for retirement, for that matter. Between the lower tax burden, the additional years to get back on track, and the better flexibility when it comes to college, we would have gladly made that trade-off.

Of course, an even easier way to avoid this type of mess would be to be more careful when choosing a home. If you're counting on being able to send your kids to a specific school, make sure your home is in the zone covered by that school. Even if it means trade-offs elsewhere, the net benefit to you in terms of financial efficiency and personal stress will likely be worth it.