You do not need to have insurance to write a smart contract. (Obviously: you've written a smart contract before and you don't have insurance)
However, your potential client may require you to indemnify them. Thus, to be eligible to write a contract on behalf of this company, you may be required to indemnify them -- this would be a term of the contract you have with them. It is not unusual for contracts to include a non-performance penalty for failure. If you are a small company, they may insist you have indemnity insurance because you can't squeeze blood from a stone. Even if you're part of a larger company, they may insist you have indemnity insurance to make it easier to obtain compensation in the case of a mistake. Or they simply may require it from all contractors performing certain functions simply for uniformity (instead of having a big company contract and a small company one). Clients requesting such a thing probably know that good software isn't cheap; if they're not willing to pony up for things like written requirements/specs; internal code inspections, automated testing, integration testing, and other V&V; and other good practices, then run away. If you're not able to provide those things, then run away; those are the sorts of things people often go to companies like IBM to provide.
Such insurance is probably not the norm in the software world, but when dealing with situations where failure is costly, I would expect this to be much more commonplace. If your contract allows for it (either explicitly or by omission), you can almost certainly be sued.