Turning airport security into customs and excise agents would be legally challenging.
Same way TSA in America largely don’t give a flying fuck when Amercians from legal states board international flights with cannabis products such as gummies or vape pens - that’s a problem for the customs people on the other side.
I should note here that some places do mix the duties - the airport security guys at Schipol will make a vague effort to stop you from taking a big bag of weed through, and will politely take it off your hands.