Files cannot be downloaded consecutively from the custom button in the same record screen for the second and subsequent times. The screen must be refreshed to output again.

 

Check your browser download settings. As an example, the settings for Chrome are as follows.

  • From Chrome settings, go to Privacy and security > Site settings > View permissions and data stored on across sites. Click on "salesforce.com". Click on the target domain URL and check "Automatic downloads". If "Automatic downloads" is "Block", change it to "Ask (default)" or "Allow".
  • From Chrome settings, go to Privacy and security > Site settings > Additional permissions > Automatic downloads. Check the URL list under "Not allowed to automatically download multiple files". If there is a Salesforce URL here, click the ":" on the far right and click "Remove".

 

Reference

How to deal with the problem of not being able to download files or multiple files from a custom button