I think the best practice for accomplishing this without hacks is two steps:
- Hidden item before exit that performs the logic to see which ending text the player should be shown. This item stores the ending text to a variable.
- Ending displays appropriate ending text using 'say'
I wrote a tutorial which covers this and variables in general: https://ayolland.itch.io/trevor/devlog/29520/bitsy-variables-a-tutorial