I think that this move depends on two things. Firstly, age, and secondly, the level of programming and/or applications.
From a personal view point, it gets harder to keep up with programming the older you get. This deterioration in concentration is obviously gradual, but noticeable after the age of 50.
Again from a personal view point, I found that very large programs, say 20,000 lines of code plus were difficult to maintain or change. I know the arguments for many small modules, but the original programmers of applications like BPCS were clearly not convinced.
Project Management on the other hand must be a natural transition from programming, and I, for one would question the ability of a PM who had no previous coding experience.
It is, however, a different landscape. You can immerse yourself in coding a complex programme to the complete exclusion of everything and everybody around you - as a PM you cannot be so unsociable, if you are to succeed.
It is also probably a one way career move only. After a break of six months or more as a programmer, it is unlikely that a prospective client or new employer would consider the gap to be beneficial, so a return to programming from project management could be difficult.
To make this career move, should, ideally, require some re-training, possibly for suitable qualifications, but if you are a contractor, you have to weigh up the course costs and time away from earning a living against a fairly competitive job scene.
I also think that the mindset has to change as well. It is reasonably easy to convince other knowledgeable people of your programming ability, but project management is a much more grey area, and difficult to move into without experience.
If you are currently employed and your employer sees this as career enhancement for you, and will offer the necessary training, I would say, grasp it with both hands - other than that you may well struggle for some time unless you drop lucky.