If I understand your question, you are talking about how your skills would be received (and then compensated) by employers and clients. I say this because one's salary comes from an employer who wants what you can do for them. If so, then I might shift the discussion a little.
There are many, many programmers out there. To make yourself attractive to employers and clients and to command a high salary, then you have to provide value equal to the compensation you seek. To do that, you either need to be in a niche that others need, or have a skill level that is easily recognized to be valuable. Is this hard to do? Not necessarily, if you understand the needs of the people you wish to serve. It's not about how good you are compared to other programmers, but how good you are at meeting the needs of employers and clients.
IT Security, is no different, but the playing field is skewed. The field is constantly mutating, needs and demands shift, and the entire definition of a 'career' in this field is in flux. At this point, you cannot study an established set of skills and trust that you would be in demand. Instead, you would need to be constantly aware of what is in demand and adjust accordingly. In this way, it is difficult to compare IT Security and a Programming career.
So, which path might be better? There might not be a way to answer that from the perspective of a future self looking back on a chosen career path. The benefit to a Security career is that it might be easy to find ways to meet market demands in creative and unexpected ways, and in that way, you could easily start off with a solid and profitable foundation. On the other hand, the shifting murk of the field might make it difficult to find a profitable base in the beginning.
Because of the uncertainty, IT Security is a 'labour of love', and those who engage in it do so because they are excited by the field.
In the end, as I said before, profitable careers are about your ability to meet the needs of the employer or client. It is not about doing what you like, having the right skills, achieving high grades, reading the right books, or how you compare to others. It's about being laser-targeted on solving other's problems. Do that, and your career is bright.