A lot of good comments here (and a couple of not so good ones...)
I think that playing in time is a lot more nuanced than just saying either you have good timing or you don't. Sure, a sense of timing is fundamental, but there is a lot more involved in applying that to a bass line. There's the basic mechanics of plucking the string, alternating fingers/strokes, crossing strings, left/right hand coordination, shifting positions, and muting, just for starters. Then you need skill in subdividing tempos, playing with other instruments, and combining it with all the other non-timing aspects of playing (e.g. dynamics, harmonic properties, etc.) So when you start playing bass lines with a metronome, you're actually doing quite a lot at once.
My suggestion is to build up to it. It may seem slow at first, but I think it's a good way to get through the issue you're experiencing without feeling overwhelmed. You could start by setting down your bass and clapping along to the metronome. Set it to click quarter notes and clap along until you no longer hear two separate sounds (i.e. the clap and the click should sound like one event). Repeat this at different tempos (go both faster and slower). As this becomes more comfortable, practice subdividing, such as having the click on the 1 and 3, and clapping quarter notes, or clapping eighth notes. Add triplet patterns as well.
Once you've gotten the feel down, and can do this with a variety of tempos, then switch from clapping to playing. Start with open strings or single notes at first before trying to tie the fingering and plucking hands together. If you listen carefully, you'll notice that the plucked note has a less distinct beginning than the click, more of a bloom. It's subtle, but it's there. It's also different on low notes/strings vs. higher notes/strings.
Then move to fingering different patterns that are relatively simple. This can include chromatic patterns or scales, assuming you can play these and still focus on the timing. At this point, you're starting to put it together, and it can go on to include more complex bass lines.
This may seem a little bit tedious, but I find that it's a small investment with long term rewards, and actually less frustrating than trying to tackle everything at once. I suggest 5-10 minutes per practice session (nearly every day, rather than marathon sessions), then do other things for the rest of the session.
One final note of encouragement. The fact that you're putting in the effort to learn, and that you hear the timing issues and are seeking to improve on them is a definite sign that this effort will pay off. I assure you, this is something we all have to work on.
Keep up the good work!