Vyxal, 13 bytes
K'2lv∑⁰vca¬;t
A bit messy.
K # Substrings
' ; # Filtered by...
a¬ # None of...
2lv∑ # Substrings of length 2
vc # Are contained in...
⁰ # The second input
t # Get the last (and longest) element
# This works because K returns the elements in order of shortest to longest
# And filtering out elements can't unsort it