this took me a long time to find.  @tsteur any idea why you put this isCliMode to false in the command, which is CLI?
This was causing bug where the redirectToUrl normally exits in SSL, and here was just printing the header and silently "failing". (when running console command)