Do you have any dash lights on when the problem occurs? If so the EMS codes will indicate what is wrong.
If NOT then your next step needs to be to check transmission oil level (I assume auto) and to scan the EMS Engine Maqnagement System for codes. This may give a lead. Unfortunately both of these jobs require special tools. However both may prove negative.
The trans is designed to limited gear changing if a fault is determined. This safeguard is reset each time you start the car.
You need to eliminate the level and codes since these may be linked to why a fault keeps being detected. How long after a restart does the problem reoccur. Does it always reoccur or does the car sometimes go for a longer period before returning the problem?
If these ideas don't help resolve the problem than I am afraid you may have serious transmission problems. Lets hope not.