Yeah, there is a reason why proper installations require actual transfer switches or at least a manual interlock to prevent both feeds being connected at the same time. I’m also not sure what would happen if your generator was out of phase with the grid when it reenergised, but I’m sure it wouldn’t be good