I'm a bit confused at what you're trying to say.
{$thread['prefix']} will take the prefix ID of the thread you're viewing
{$thread['threadprefix']} will display the prefix "name" of the thread you're viewing
{$similar_thread['prefix']} will take the prefix ID of the thread in the similar thread row
{$similar_thread['threadprefix']} will display the prefix "name" of the thread in the similar thread row
In the last code box you posted
here, you're mixing the viewing thread's ID with the similar thread's name (so the link may be incorrect if the two are different).