When your check engine light comes on, that means that the ECM has stored a fault code. By the time you got to the dealer, it may no longer be active but I believe it should still be there in history, unless you cleared it. . And yes, it's very true, that when you have an electrical problem that is not currently acting up, you just have a normally functioning electrical system. You have to identify exactly where the problem is occurring - what is the cause of the problem. You recorded what the codes were so that's good, but the tech can't see the problem because they are no longer occurring. If you told the tech to keep checking - you'll pay for all the hours it takes to fix it - you may be a poor man soon.
At this point, and to save you money (if you care about that), keep driving until the codes come up again and do not clear them. When codes are created they also create a file of collected data points when the problem occurred and that may help a tech to find the solution.