Thank you, @JatinChopra, for the clear answer.
Do you know the answer why downloading attachment using OAuth2 and download link
like “https://{instance_url}/wiki/download/attachments/{id}/{name}” was working and all of a sudden it stopped working? Now there is 503/401 error described in the question.
Cheers.