Google OR-Tools - Routing - Penalties - Adding Different Penalty to Different Location (Python)
Given your code, it looks like data['penalty'][manager.NodeToIndex(node)] is not an integer, probably a float, and therefore it doesn't match the function signature, as the error message suggests. Try converting it to an integer.