Linked Server to Mirrored Database Fails
This is a known issue.  Linked servers which are looking for database mirroring logins only work for Windows logins not SQL Logins as talked about on this connect item.  Basically you need to either hard code a username and password in the linked server, which isn't recommended or use Windows authentication to access the linked server.

Another option would be to setup alerts and SQL Agent jobs on the two machines so that when the database becomes active on those machines they automatically reconfigure the linked server with the correct servername.