Best I could guess is the usual pseudo-behavior of uninitialized associative arrays. Meaning passing them by value and then adding keys to them works but only if that array was already initialized. It's a current edge-case in the implementation. Try using ref
however, it should fix things:
static ResourceInfo getOrCreate(Object resource, ref ResourceInfo[uint] map)