A lot of the most serious software engineering work that I have done had much the same ratio: coding the a solution that mostly works was easy. Making sure that it is robust against all kinds of failures (CPU, RAM, bus/external device failure, random bit flips etc.[0]) and does the right thing was a lot of work.
[0] The system I worked on was hardened against all of that and some more failure modes.
[0] The system I worked on was hardened against all of that and some more failure modes.