Ideally before $wgMaxRedirects is set to > 1 on wikimedia sites (i.e. T65388: set $wgMaxRedirects = 2 on dewiki and T67064: Increase $wgMaxRedirects on enwiki), the API should somehow indicate when a title has a redirect chain which is longer than $wgMaxRedirects.
This might be done by simply exposing the value of $wgMaxRedirects in siteinfo, allowing the client to determine if the redirect chain is too long.
And/Or an API warning when the redirect chain is too long for a title queried.
And/Or prop=info includes a flag in the "redirects" block to indicate which redirect target the server will actually be loaded.