UPDATE: We received a response from a Level 2 support contact. At least in our situation, on the times when the custom js did not execute, it appeared that none of it ran. However, it turns out that portions of the script indeed did run every time. Thus, the problem had to do with how items on the page are rendered in the browser. If you're using jQuery, it's not enough to wrap your code in a document.ready() block. Instead, you'll need to make sure any page element you are manipulating or referencing with your script is fully present on the page. A helper function (for example, onElementRendered) should help with this. Since our code has been working problem-free for several years, I'm not sure if something changed in the Catalog codebase and/or the way browsers render the DOM, but the change was significant enough to start causing this new issue.
In our situation, we've also been looking to move away from jQuery in our custom script, so we took this opportunity to do that as well. Upon first simply converting our existing script to vanilla JavaScript, we experienced the same inconsistent behavior. However, once we updated the vanilla script to always check for an element to be rendered before attempting to manipulate it, things seem to be working properly.
We're still double-checking things before closing our case with Instructure, but I wanted to share an update here for those still investigating your own instance.
Bottom line: be sure your code checks to see if a page element is rendered before attempting to reference or manipulate said element.