Is the ancestral condition of prehistoric amphibians and early amniotes urea excretion? Would it follow then that the lineage leading to living reptiles went on to evolve uric acid excretion as a derived trait? Therefore urea excretion is a shared plesiomorphy of living amphibians and living mammals relative to a synapopmorphy of uric excretion in living reptiles?
There are reptiles that also use urea, and mammals that excrete uric acid. it is likely that urea is the ancestral condition (compared to uric acid) as it occurs in adult amphibians and some fish. But ammonia is even more ancestral than that, occurring in young amphibians and most fish. It is likely uric acid developed alongside terrestrial eggs, as every egg laying amniote (including monotremes) uses uric acid at least during the embryonic stages. Uric acid is more metabolically costly so there is some incentive to switch to urea if you can, although there is a counter factor as urea requires significantly more water. so it comes down to which a group can afford more water or calories. It is notable that the few reptile to witch use urea only switch during their adult stage. It is possible to do both a few desert mammals produce uric acid and urea at the same time, producing more uric acid when water stressed.