The ConnectWebParts method cannot be called after connections have already been activated (in WebPartManager.PreRender).
This problem occurred because I connected WebParts in Page_PreRender event.
this.WebPartManager1.ConnectWebParts(provider, providerConnectionPoint, consumer, consumerConnectionPoint);
Moving it back to Page_Load event, everything works fine.