Hendrika,
I think your issue is caused by the use of the SAML module in combination with the direct URL.
In a test project I tested the use of the direct URL with a default login setup, locally as well as in the mendix cloud. Adding the URL data like /test/{Id} shows the user the URL including the ID in the address bar of the browser when accessing the detail page from a grid (so not directly from the URL). Using this shown url I was able to access the data when pasting this in a separate tab and even in an anonymous browsersession (needed to login first in the latter case). Even tried to get the ID of a second record from a microflow (the id is available when debugging) and using that in the URL directly works fine. In all cases with or without the profile indicated.
It seems that the redirect taking place from the SAML request does not keep your /test/{Id} data when the callback is made from your SAML provider and is causing the login process to loop.