Trying to invite a user into a room in which they are already present will give you a pretty generic M_FORBIDDEN. While this is perfectly valid, it does mean applications do not have a spec complaint way to treat this case differently to other errors. The only way to distinguish a failure due to membership conflict and a failure due to other reasons is by checking the error body for a "is already in the room" (in the case of Synapse).
I'd argue that there should be a specific error code for when a membership change was not possible, so applications (such as bridges) trying to ensure membership in a room can short circuit if the error returned tells them that the user is already joined.