Warn as last statement in function results in returning Puppet::Util::Log class object, which is very much not expected behavior. Return nil if you can't find anything, like the rest of hiera.