Well, it certainly could be that. I bought a not inexpensive bass some time ago to find the strings didn’t sit right across the fretboard. I was advised that the long standing method of dealing with Fender’s that suffered from this was to give the neck a good whack and 99 times out of 100, everything would come back into line. I believe @Chiliwailer may have pointed this out. I didn’t actually do that. I took the strings and neck off and reassembled - problem solved. Same method, just less violent 😂.
If it isn’t that in the OP’s case, it could be the bridge, the nut, the saddles or a bit of all three.
There are a number of basses in the Marketplace that have strings way out of true. There is one particular one that I really like, but the photos just don’t sell it to me. I don’t understand how there can be that many hi-res photos blatantly showing a bad misalignment in the hope that it will sell. It still hasn’t sold, so I guess the proof is right there.
The first thing I look at on a bass that pique’s my interest is string alignment. If the photos don’t include a straight down the neck shot to the headstock showing that, then I either ask for one or pass.