try to add a debug message to figure out first, if your config is defined or not:
Lua Code:
d(Config.MaterialFilterSettings.LootAlchemy)
d(Config.MaterialFilterSettings.LootCooking)
second thing is, you check for , but you maybe forgot to define the itemType? maybe it's better if you post the whole code of the ItemFilter function.