I'm working on a site that is using a theme with an attachment.php file in the theme. However, when going to an image's attachment page (i.e. https://domain/john-doe/) it loads the direct image (i.e. https://domain/files/2020/03/john-doe.png).
What would cause this to occur? I thought WordPress would load the attachment URL and present the item as coded in attachment.php, not the media file itself.