Could we check the duplicated topic title for the each category only?

Just to amplify on what @david said, if you look at the way the URL is constructed, the category is not part of the URL:

https://example.com/t/topic-title/1234

so if there were duplicate titles in two different categories the URLs would be confusingly close together – other than the id number of course.