Invest in hands before guitars
The guitar is only one component of the produced sound. How and where you attack the strings with your right hand changes the sound dramatically. Your favorite P or J sound is probably 25% guitar and 75% player technique.
Don’t you believe me? Well, try it for yourself.
Get a J-bass. Assuming that dimed knobs are 12:00 PM, keep the neck pickup dimed, decrease the bridge pickup & tone until 09:00. Now, play right between the neck pickup & neck using the fleshy part of your right fingers like pillows. Doesn’t that almost sound like a woody uprighty P-Bass?
Now, get a P-bass. Dime all knobs. Play really close to the bridge using the tips of your fingers, and attack the strings with short staccato hits. Doesn’t that almost sound like a Jazz bridge pickup?
There you go… There is no rule that you should sound 100% like this or that. Almost any guitar can be used to occupy almost any sonic space in the spectrum with a convincing sound in ideal situations.
However; many of us may lack that level of technique and/or may often be playing in less-than-ideal situations.
Less than ideal situations
Theoretically speaking; given the time and energy, any bass can be used in any setting. Band members need to agree on the frequencies to occupy and EQ their instruments accordingly, while sound engineers ensure that the same logic is applied into the FOH & monitor speakers.
Practically speaking; unless you are an A-level professional artist, not every musician or engineer will have the experience, ear sensitivity, time and willingness for such precise sound calibration. Therefore, most of us will need to pick the instrument which will naturally serve them best in less-than-ideal conditions.
So, despite the fact that any bass can theoretically be used anywhere and the tone is in the hands, it would be wise to pick the instrument matching your requirements the most. It will serve you better overall.
Just don’t invest a fortune. Invest time in your hands instead.
Musicians are story tellers. Your guitar is your pen and your tone is your font. It is good to have a comfortable pen and a font that matches your message; but your story is what matters the most.
In the end, you got to pick what feels right to you and helps you tell your story using the language of music.