You might be interested in Renovation Angel [0] and the Habitat ReStore’s [1] efforts in this space. It certainly takes a nonprofit equipped to handle this kind of donation, but they’re around in some places.
Habitat ReStore turned me away multiple times with brand new light fixtures and other new materials after a remodel. Both times they were at capacity. At some point my need to be rid of the excess thing exceeds my desire to do the right thing and warehouse it until they decide they’re ready for it. Into the landfill they went.
My wife has found a local “Buy Nothing” Facebook group that she posts all sorts of stuff like that on. Most of the time someone is happy to jump in and take things like that off our hands.
List on Facebook Marketplace for free, usually spoken for within the hour (in my experience with surplus or unneeded building materials, fixtures, etc).
[0] https://renovationangel.com/ [1] https://www.habitat.org/restores/find-donate-building-materi...