Do not switch to same app on attached (external screen)
It sounds like you're breaking the Spaces paradigm by having one app over two Spaces. If you do that, behaviour will be at best unpredictable. 

You could possibly mitigate this by unchecking System Prefs > Mission Control > "When switching to an application, switch to a Space with open windows for the application" [but this is untested as I don't use "Displays have separate Spaces".]