So, if you try 'equipped_item.realm' it may return invalid information? And to be sure of it's realm you'd have to use e.g. equipped_item.container.realm to get the always correct realm?
Maybe the fix to the previous equipping from another realm bug you found is just a halfway done so far.