How's your water intake? Alcohol, caffeine and juice intake?
If your bladder, urethra and prostate are fine, then start looking at other things. Perhaps it's associated with times you are dehydrated or irritate your bladder or urethra with too much alcohol or caffeine and not enough water.
I would expect them to look into urethritis. Sounds like a pretty solid match to your symptoms. Antibiotics would be something I'd want to try. https://www.webmd.com/a-to-z-guides/urethritis-symptoms-causes-treatments#1 While std's can lead to this, it's not the only way. It can happen from your hygiene and how you wipe after a load. Really, it happens.