The extent of functional redundancy changes as species’ roles shift in different environments