This is ignoring the fact that the main reason retired phones are e-waste is proprietary firmware blobs and locked-down systems preventing users from maintaining their phone with security updates, and very limited support length from OEM's leads to VERY insecure devices after they drop out of support.
You should not be connecting these old devices to an internet accessible network.
Google notably does well here with 7 years of support, but others such as Sony are 4 years, and Xiaomi on non-flagship devices are similar, or Samsung on their lowest budget models...
Beowulf cluster time for old Pixels?
Speaking as someone who has a cluster of four RPi Zero W’s mounted in an Ikea picture frame running as a Docker Swarm cluster, I LOVE this idea.