If I knew I was in for a 40 minute wait, I would have gone through arrivals and then walked upstairs and back through departures. This trick works well at LHR T5.
It surely would have been quicker? I don't depart from AMS that often so I'm not so aware of how busy Schengen departures gets.