I'm going to lean toward the part itself, as I've replaced a couple of them on 7 plusses and one on a 7 and haven't had an issue with the auto brightness. Here's the last one I got for the 7 plus.
[link|https://www.ebay.com/itm/142749379428|New Proximity Sensor Light Motion Flex with Front Facing Camera iPhone 7 Plus + 721249108448|new_window=true]
They're cheap enough I'd just get a new one and not worry about the one that doesn't seem to work.