If you can do most of your days in one of the countries and not be tax resident that may be the easiest. So if your work does not require you to be physically present your case gets less complicated.
Yes, I am either fully remote or partly (2 days tops in CH). Then I wonder if my initial idea is possible. Work 2 full days in CH (Mon-Tue) and have been here Wed morning (until my flight to Spain) and Sun night (when arriving from Spain). With this scenario, I can be taxed in CH and keep my permit B? as long as I have more than 1/2 year here, it should be fine, no?
A G permit is only for people resident in a neighbouring country’s border zone, no? And they have to have lived there for six months.
sounds like a no.
why don't you call up the cantonal migration office? some small details may make a huge difference