What shop did you go to? Are they a Subaru shop?
Look at your Uppipe, the heat shielding on them is notorious for rusting and creating a rattle at certain rpms. What could be happening is you get that rattle and the car recognizes it as knock so it pulls the timing and greatly reduces your power.
I highly recommend you get in the TXIC forums and find some guys in your area that can either come check out your car or recommend a Subaru Tuning shop to you. I can pretty much guarantee you need to have a stock STI map loaded on your car.