Ammonia is a simple nitrogen based waste product. However, it is very toxic to life. Fish however live in water, and because the volume of water is high they can excrete ammonia as a waste product. This method of waste removal can be a problem in fish tanks, because the water volume is fixed. New fish tanks struggle initially with ammonia levels, because the bacteria cycle has not started. Too many fish in a small volume tank can cause ammonia spikes. Ammonia a very low ppm is toxic.
For an animal to use ammonia as a waste stream, the animal will require a lot of water. Animals such as birds, reptiles, and desert animals cannot afford to consume and lose much water. Birds would be heavier, making flight difficult. Many reptiles and desert animals live in areas where water is scarce. Typically, these types of animals will excrete uric acid. Uric acid is a solid and not very soluble in water. That is why bird crap is a paste. Too much uric acid in mammals can be a problem. Gout is uric acid crystals in the joints.
Mammals typically excrete nitrogen waste as urea. Urea is soluble in water, hence liquid urine.
I am not a biologist, but this is my understanding of how nitrogen waste is handled.
I searched worm excretory system. Limited information said worms excrete urine. I suppose the urine is composed of urea. Just guessing, but I think your experiment should have yielded a higher concentration of urea for the worm with low ammonia. The fish should have higher ammonia and low urea.