People don't want to hear this but: it depends how smart you are. A smart 36 yo with a reasonably quantitative background (training or career) can become a competent software engineer quite quickly. Most people cannot.
Yeah, though I've seen a lot of raw talent in people who just can't stick it out. I think this is more correlated fields and perhaps a mix of tolerance for fields with similar frustrations mixed with coping strategies for dealing with failure based on technicality.
At any rate I think a lot of people fail out of programming and into another tech career, so it's not really a bad idea for a 30 something from any field.