Trying out asp.net core in .net 6 and having a redirect issue I cannot explain

I have happened upon some code that indeed changes the paths for the cookie, such as:

.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options =>
{
    options.LoginPath = "/login";
    options.LogoutPath = "/logout";
})

However, it will just create an infinite loop, but for some reason the same thing in the sample using the AccountController doesn’t create an infinite loop.