Concatenating together a list of the different roomobjects could work fine. However, your array (finds) does not contain all the hostile creeps, hostile structures, etc. What it actually contains are the constants mapped to each of those find conditions. According to https://screeps.com/a/constants.js ,that would be: FIND_HOSTILE_CREEPS: 103, FIND_HOSTILE_STRUCTURES: 109, FIND_HOSTILE_SPAWNS: 113, FIND_HOSTILE_CONSTRUCTION_SITES: 115
So you're not handing it an array of all the hostile targets in the room, you're handing it an array with the content: [103, 109, 113, 115]. Since findClosestByPath will accept either a constant (representing one of those find conditions) or an array of roomobjects, it tries to process it as an array of roomobjects and fails.