Good question, Keerthana.
You can take and pass the AZ-400 exam anytime, even without AZ-104 or AZ-204. But — to earn the “Microsoft Certified: DevOps Engineer Expert” badge, you must hold either AZ-104 (Administrator Associate) or AZ-204 (Developer Associate) as a prerequisite.
So, if you pass AZ-400 first, your result stays valid, but you’ll only get the Expert certification after you also pass one of those prerequisite associate exams.
You can check the official note here: Microsoft Learn – DevOps Engineer Expert.
Hope this clears it up.