If there are enough poisonous mushrooms, it is possible that most animals decide to leave mushrooms alone regardless of distinctive coloring. That seems to be the case because mushrooms tend not to be bitten by large animals, at least when i go mushrooming. If that happens, it is possible that other mushrooms do not develop poison but rather freeload on the poison of other mushrooms.
Thus, one may guess, that first distinctive poisonous mushrooms like the fly agaric developed, then most animals large enough to eat them developed an instinct to avoid all mushrooms, and then the non-poisonous freeloading mushrooms developed.
There are some psychedelic mushrooms in the amazon that use their psychedelic effect to zombify ants and force them to spread the mushrooms spores. That is really disturbing, find a youtube video of it if you feel like having some nightmares.
Furthermore it should be noted that the poison or the psychedelic effect may not even be relevant for evolution. The poisonous or psychedelic compound may be produced for completely different purpose or as a byproduct of the production of another useful compound.