/page/{title}/links/media returns 500 error when more than 100 media files present, but as per documentation at https://www.mediawiki.org/wiki/API:REST_API/Reference#Get_files_on_page, 500 error is supposed to happen if the page has more than 500 media files.
The following examples illustrate the issue:
https://en.wikipedia.org/w/rest.php/v1/page/Barcelona/links/media
https://en.wikipedia.org/w/rest.php/v1/page/India/links/media
{"messageTranslations":{"en":"Too many media links found on title India (100 allowed)"},"httpCode":500,"httpReason":"Internal Server Error"}