I've been trying to find the answer to this question on the internet but not finding anything helpful. The EU calls this situation a "cross-border commuter", but all their advice assumes the person is an EU-national or someone with the rights of one (i.e. EU family member, etc.). Some of the other stackexchange questions weren't quite applicable because the person was either a UK person trying to sort things pre-Brexit (and they got special treatments) or they have a permanent residence card, which I don't have.
I am an American living and working in Baden-Württemberg, Germany (I do not have a permanent residence card as I have only been working here for 2 years; I can switch employers now), but I am considering applying to a position in Austria, which has "flexible work from home arrangements". I am thinking I could primarily work from home in Germany and just commute to Vienna a few times a month. The problem is that I need a German residence permit to continue living in Germany, which is normally provided by the local government because of my working status. For personal reasons, I need to continue living in Germany, but I would really like this research position in Austria.
Is anyone familiar with a situation where a non-EU national was able to live in one country while working in another and get a residence permit from the country where they reside, not work? Would the Austrians let me work there without living there as a non-EU citizen? (I'm assuming as long as I had the German residence card they would, but some reading has made me doubt this...)