How do you get the shower diverter out of the tap casting if you have taken the brass nut off but cannot remove the diverter stem because it rotates 360 and has no threads?

Some faucets have a C clip on the outside that hold the cartridge in. Some have an inside clip. It may be that you just need to pull straight out on the stem. Possibe to break something doing this, but sometimes it takes a bit of a pull. You can spray some WD-40 or similar on it and let it set awhile. you may have taken the bonnet nut off, you still may have to get socket wrench on stem nut in wall to take out diverter ( deep socket wrench works good but you may have to chip some tile around stem to get socket on it )