Not sure I follow - if the codes don't exist then you would get an error - that is to be expected, no ?

If multiple Role IDs exist within the string then the method outlined will return the last listed (List sheet)

Re: avoiding partial matching / false positives, if as implied the Role IDs are always encased within underscore then it would be better to adjust accordingly

B2:
=LOOKUP(9.99E+307,SEARCH("_"&LIST!$A$2:$A$187&"_",$A2),LIST!$A$2:$A$187)
this is something I should have added to the original suggestion, not doing so was an oversight on my part