The DenyAddAndCustomizePages setting in the SharePoint online is a policy that controls whether users can add or customize pages with custom scripts, which can include JavaScript, HTML, and other code that could potentially pose security risks.
So, you must need to disable DenyAddAndCustomizePages when you want to upload .aspx files to the document library.
As you mentioned in the original post, currently by designed that "DenyAddAndCustomizePages" automatically be reset back to disabled after 24 hours.
In order to be able to upload aspx file into the document library at any time, I suggest you automate run PowerShell to disable DenyAddAndCustomizePages daily, you can use Windows Task Scheduler:
Task scheduler is a Windows-related app, not my field of expertise, you could refer this post to configure task scheduler with SharePoint online.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.