With gerrit patch https://gerrit.wikimedia.org/r/#/c/132410/ the reason why a title is invalid is now better reachable and may can be included into the api with optional error message when doing processing with the ApiPageSet (action=query and friends).
For example this can be used by the LinkDialog in WikiEditor which at the moment just say "Invalid title" when typing invalid characters.