Learning on the job can yield painful lessons