No, there are no such devices. Not even a human can do that, much less a machine.
Analytical chemistry is a fascinating subject and an arcane art, and it needs many years to master, as well as access to expensive equipment and reagents. But humanity is no closer to creating a tricoder than it's to sending a spaceship to another solar system*. Typical work in analytic chemistry looks like this: you know exactly one substance you're interested in, you have a mixture which may or may not contain it, and somebody has to develop a validated method for detecting that substance. Creating such a method alone is enough to get you a publication (sorry, that one isn't in a kitchen context, I hope you're not weirded out by reading about rat blood - but since the full text is available, it's worth skimming just to see what it entails).
Let's say that you were determined enough to become a trained analytical chemist, to the point where reading that paper feels to you like a baker reading a cookie recipe or a musician reading a score, and you have access to a well-furnished lab. From there, the process to analyzing your food would look like this: 1) make an educated guess at which ingredients are likely to be present, 2) search the literature for compounds that might be indicative of your ingredients, without being too common, 3) for each compound, find a published method for detecting it, 4) do the detection for each, 5) combine your results to see which of your guesses was confirmed.
After having done all this work, at a huge time investment, what you have is a confirmation that some of the ingredients you guessed are indeed in the food. What you don't have is: no certainty; results which are only valid under a range of restrictive assumptions; no names of ingredients which you didn't think of checking for; no ratios; and certainly no preparation methods.
A much better way to go about that reverse engineering process would be to hire a human specialist - a cook, not a chemist. Normally, a good chef will only take a couple of tries to some dozens of tries to reverse engineer a recipe, needing only a supply of the finished dish and access to the proper ingredients. This is likely still way too complicated and expensive in comparison to what you had in mind, but it's still orders of magnitude cheaper and easier than the analytical chemistry route, and it actually brings you the result you needed.
For an actually workable solution in everyday life, just try to get the recipe from whoever cooked it.
* That statement might be a bit obsolete. I have heard that big chemistry corporations are actually working on "electronic noses" where the end goal is pretty much what you are describing - the marketing promise is that you dip a sensor in a cup of tea and the system tells you exact which tea it is. I only know of it third-hand and I'm a bit skeptical about how close they really are to getting it to work.