The first screen shot shows the "record" for a William Thomson who arrived in Philadelphia in 1921.
Searches can't be conducted on the "friend's name" using the search screen because it's not included in all arrival entries (the Philadelphia database starts in 1800 and entries from that time frame don't include much additional information beyond the name, age, and origin). I'm not certain when the Philadelphia records started including friends--and when Ancestry.com started including them in their index.
But these items can be located when searching based upon keyword. That's how the 1921 reference for Mr. John Frame as a friend was located.
Apparently Ancestry.com included the friend's name from some of their Boston arrivals as well.
I've seen friend's name as a part of the extraction for the ports of: