Issue here is that for Blender, any pass which name starts with 'Diffuse' is considered a diffuse pass - and it does not really support several passes of the same type in renderresult. So for now, passtype_from_name() is now checking whether a pass of same type already exists in render layers, and return 0 (uknown passtype) in this case.