Generally, is a US Air Force Weapon Systems Officer (WSO)
someone who wanted to be an WSO or is specifically assigned and trained to be an WSO from the start, or
someone who failed flight training in some way?
Short answer: #1 is the most correct statement, but it doesn't tell the whole story. #2 can happen, but it's very rare for the reasons described below.
To understand this you need some understanding of how the USAF personnel system operates. One key factor that constrains how the system operates is that it's designed for a constant flow of personnel through the system where everyone starts at the bottom (for officers, that's a Second Lieutenant). Over time, each year group (people commissioned in the same year) will eventually go before a promotion board. Failure to be promoted normally results in being forced out. Add in people who just quit (after they've met any service commitments), and the year group gets smaller as you move up the ranks. This makes sense as there are fewer people at the top of the chain of command.
The downside to this is that the USAF can't go hire a bunch of 10-year Captains or 15-year Majors if they find themselves short of personnel in that range. So everything in the system is based on long term projections - not just how many do we need today, but 5 or 10 years down the road.
This process is applied to each career field, of which there are dozens. In general, when you start in a career field you will be in that field for your entire career. It is possible to change career fields, but it's not all that common. The biggest factor will be staffing level in your current field and the field you're trying to move into. Moving from an overstaffed field to an understaffed field is possible. The reverse is virtually impossible.
The pilot and WSO careers are complicated by the fact that it has a very long training pipeline and there's an age limit to start the training. So the process of selecting pilot and WSO candidates starts before you ever get commissioned. For the AF Academy and AFROTC cadets, this starts when they enter program where they get to state their desired career field. The number of available slots in each career field are set based on projected needs 5 to 8 years in the future.
Realistically, almost everyone wants to be a pilot. But it can't happen. When I went in the AF limited the pool by setting very high medical standards. The need for uncorrected 20/20 vision cut the candidate pool down to a more manageable size. The standard for WSO/Nav, etc. at that time was 20/70. So WSO was a backup for those who couldn't meet the 20/20 eyesight requirement (or get a waiver). Grades in school as well as performance as a cadet determined whether you got a slot. Some who asked for pilot were offered WSO slots. (I was an engineer and couldn't pass the eyesight for WSO.) And if you screwed up in school, you could lose it the next year.
My senior year (AFROTC) there was a force cut which cut the number of slots. Pilot candidates that lost their slot were given options. Some were offered Nav/WSO or Missile slots, others were given the choice of taking a non-rated career, going in the reserves, or just dropping out of the program with no penalties. I know people that took each of these options.
But even with all this planning, things change. So if you did come in as a non-rated officer, there are some limited opportunities to make it into pilot training. It's a long shot, but if you do really well as a Lieutenant there's usually a few selected each year to become pilots. You don't have much time to do this due to the age limit to start pilot training.
As to the second option, if you were to wash out of pilot training you would not be automatically considered for WSO as that pipeline is likely full. You could apply for it, but again that would be long odds (and the reason for washing out of pilot training would definitely have a bearing on your probability of success.)