I’m a software engineer. In my experience, there’s no shortage of software engineers, despite all the bleating in the computer industry. Given that there is no shortage of software engineers, companies can be, and often are, very picky about who they hire. Job interviews can consist of hours of white board questions. Even if you do well on these questions, you may get turned down for the job because they don’t think that you’ll fit into their “culture” (e.g., you’re not a young male of the appropriate ethnic background).
Unless your previous employers is willing to welcome you back, leaving a job after just a week could be a real problem. At least for a software engineer who has bills to pay. You could spend months unemployed.
When I’ve been unhappy at a job, I always try to find a new job before I leave the old job. Interviewing for new jobs puts the job market into perspective. If you succeed in getting an offer for a new job, you know that you will not have a long period of unemployment when you leave your existing job. If you don’t have any job offers or any job offers that you like, you have an incentive to try to adapt to the existing job.