Try checking the contents of the black console pane at the bottom of the Arduino IDE window when that happens. There will usually be some detailed output there when a Boards Manager operation fails. That information can provide valuable clues about the problem.
Are you able to look at the Arduino IDE window after that happens? If so, pleas