If you do a Google search for "cayenne ulcers" you will find a goodly bit of information, some of it conflicting. Cayenne has indeeed been used to treat ulcers and it has also been reported to cause ulcers and gastric distress. What I have found and what I believe is that smaller amounts of cayenne have been beneficial for many people in treating ulcers but the larger amount you use the great the risk of aggravating or perhaps even causing them due to cayenne pepper .
That article is perhaps a bit negative in tone, but it does match up with other warnings you will find.
If I were you I would give myself a cayenne break of at least a couple of weeks or more and then build back up slowly, stopping at any signs of further problems like you described and keeping the amount you take at a more modest level.
For the record, I love cayenne almost as much as my faithful steed Rocinante.