We're sorry about the experience with Photoshop while trying to export the GIF. Would you mind sharing the version of Photoshop you're using along with your computers macOS version? Since when are you facing this issue?
If you're using macOS Catalina or macOS Big Sur, please ensure that Photoshop has the necessary permissions using the steps mentioned below:
1. Go to the System Preferences for your Mac, then Security and Privacy, then select the Privacy tab.
2. Then select Accessibility from the list to the left & check if Photoshop is added to the list with a check mark in front of it.
3. If Photoshop is not a part of the list, please add it by unlocking the window first using the lock at the bottom left, then clicking the + icon & navigating to the Applications folder.
4. Also, grant permissions to Photoshop under Full disk access located in the same list as Accessibility.
5. Once done, restart the Mac & check if it helps.