You can raid with people from shield as a sword player, and vice-versa (this includes G-max Dreadnaw/Corviknight).
The thing about G-max Dreadnaw/Corviknight is that when you check which pokémon you are going up against, there is a higher chance to have G-max Dreadnaw appear while playing sword, while G-max Corviknight for shield. This is due to an event going on until january 2020.