The handful of times I've had ulcers in the past it was certainly correlated with stress. Perhaps indirectly through some other effects, but stress feels like part of the equation IME, at least for some people.
You likely have chronic heliobacter pylori infection and should really look into that. It’s a silent killer and that way beyond just ulcers since it’s a potent acetaldehyde producing microbe. Tests are often false negative because they can hide in places, eg Candida vacuoles: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8101746/
Is there a better test than the one that is normally prescribed, to distinguish the false positive cases you describe?
Antibiotics are diagnostic in a sense. Take antibiotics active against H pylori. If your ulcer goes away, it was H pylori.
AFAIK testing for those just isn’t very good, sorry.
Stress can aggravate ulcers, as it can aggravate any number of underlying conditions. Similarly eating spicy food can make the symptoms of acid reflux much worse thanks to capsaicin in the refluxing acid. But in both cases the root cause is something else.