First place to start would be to create a new macOS user account, log out of your current user account, then log into the new user account to see if you have the same issue when launching the Terminal app. If you don't have the error in the new user account, then something in your own main user account is causing the problem. If the new macOS user has the same issue, then you have something running or configured system wide which is causing the problem.
If the issue is related only to your main user account, then disable all the Login Items to see if one of them is causing a problem. Also make sure to quit all open apps and reboot making sure that the "Reopen Windows when logging in" is unchecked.
If you still have the issue with your main user, then rename or move your hidden Zsh configuration file(s) in your home user folder since one of those zsh files has been misconfigured or is running something which is breaking things. Hopefully that will allow you to regain use of the command line, but any third party items which modified the zsh profile files probably won't work. Then you just need to figure out what in that file(s) is causing the problem.
If the issue is system wide affecting even a new user account, then try booting into Safe Mode. If Safe Mode "fixes" it, then you have some third party software installed which is interfering with the normal operation of macOS.
If all else fails, you can perform a clean install of macOS by erasing the drive before reinstalling macOS....this destroys all data on the drive. Without knowing what caused the problem, you must be careful when restoring from a backup...probably best just to manually transfer your files from a backup unless you want to go through a clean install process several times.
Edit: Forgot to provide links:
Add a user or group on Mac - Apple Support
Use safe mode on your Mac - Apple Support