I changed http.php last line to:
print Osticket::get_path_info();
And it stopped the redirect. In the URL I see on browser now there is microsoft error:
+is+not+configured+as+a+multi-tenant+application.+Usage+of+the+%2fcommon+endpoint+is+not+supported+for+such+applications+created+after+%2710%2f15%2f2018%27
So I guess there is an issue with the configuration (on the Microsoft side) and it breaks the redirect and doesn't present the error.