2005 Mercury Sable V6 Automatic

The car started to idle at 6,000RPM’s when it was started and when put in gear it idled at 4000RPM’s. Last week our mechanic changed the idle air sensor valve and it was ok for a few days. Now the car idles at 6000RPM’s and will not go faster than 25mph. The Check Transmission light on the dash is on and the fluid in the transmission checks ok. He say’s the transmission went into emergency mode and the cost to repair it will be in the thousands of dollars. Any suggestions?