But, assuming, you're right, you should have switched jobs yesterday to somewhere where you can be challenged. How can you be sure? You can't. But making sure to utilise the interview process is a good starting point. If you walk out of an interview just as unsure that the place won't challenge you, then either you've not asked enough questions, or they gave very wooly answers (which is a pretty good sign that the place isn't right for you).
Good luck. Feeling lonely sucks.