While no one can say without the full context that's missing here, from your variable names, I might assume these are collections and not a single device. I'm pretty sure Hubitat won't let you use currentValue on a collection (likely technically something like a DeviceWrapperList), and your error seems to support that. What I would do instead is either iterate over or search through the collection (any standard Groovy method for doing this should work) to retrieve or calculate whatever value(s) you're looking for in a way that makes sense for your app. Alternatively, you could make devices a single device and not a list (e.g., without multiple: true on the input).
Since it's hard to say without seeing more, hopefully this is enough to get you the right track!
It’s hard to say how to fix this without seeing more code. Devices could be a list which causes this error. As mentioned above you would want to use .collect but now you have to see what the code does with the results as that may break as well.