I am a little confused as to where you are putting this formula. If it is the ITEM component on the form then it will not work because it is expecting a record/item to populate the form fields and not a displaymode value.
The following link has some good information on the DefaultMode property for Forms but in summary:
If the default mode is "Edit" ...
This the expected behavior since InfoPath doesn't supported customize forms in Event List or Library.
As you said, PowerApps is only available for modern experience lists, not classic lists.
Currently, we could customize the new and edit form of calendar in SharePoint designer.
Refer to following article:
Solution using JQuery:
Have you referenced jQuery file in your code (I suspect you haven't)? If Yes then below code should work for you:
If you have not referenced JQuery file then you can refer it like below in your HTML and then use same code as above:
Rather than use SharePoint directly, consider using a Microsoft Form. You can embed the Form on a SharePoint page, if you wish.
From there, you can connect to the Form using Power Automate and create a flow to pass the responses from the Form to Azure DevOps into your backlog.
As per my understanding (Correct me if I am wrong), you forgot to add the type="button" to your button element.
So, Add type="button" to the button.
<button type="button" onclick="yourFunction()">Click Here</button>
Reference: prevent refresh of page when button inside form clicked
Also, it will be easier ...