I'm not sure why you were told not to take anti-anxiety medications with Prilosec, but many anti-anxiety medications can be taken in conjunction with Prilosec.
The absorption and excretion of some anti-anxiety medications (specifically benzodiazepines) are affected by Prilosec, but adjusting dosages or the time between doses can compensate for any potential issues that may arise by taking the two together.