On desktop, you'd view the full playlist and notice "Unavailable videos are hidden" at the top. Click the kebab menu and "Show unavailable videos" and the list will populate grey-icon videos which do still link to the broken video so you can get the ID.
But videos will also be broken in a way that this method does not reveal (it will only show private and deleted videos). Copystruck or georestricted videos you'll only find out once you attempt to view. Use a YouTube playlist downloader to quickly see which those are.
And then there will be videos you know existed but aren't in a playlist--I have relied on googling around for old forum and blog posts that include the link in order to get the original ID, if I didn't click on a broken link in the first place.