The problem is in DEBUG mode MAUI has "Internet" and "Write external storage" permissions by default and those are missing in Release mode and has to be included explicitly when changing from debug to Release mode.
This resolved the problem.