This is related to something known as Connection Resiliency. The link is specifically for ODBC, but connection resiliency is implemented in all client APIs from Microsoft. The page includes a link to a technical article about the feature.
In short, what it is all about is that if your connection is cut for whatever reason, the API attempts to reconnect and continue as nothing has happened. This is an important feature in the days of the cloud, since intermittent failures are common. They could be due to glitches in the network connection. But it could also be due to failovers of your Azure SQL Database from one computer to another in the Azure Data Centre because of maintenance.
While connection resiliency saves you from some of the problems this can cause, it does not cover everything. There are situations when reconnecting and pretending as nothing has happened is not the right thing, for instance if the connection was severed in the middle of a transaction.
And the retrieval of @@rowcount also falls into this category. Say that you have a script that goes:
INSERT tbl(...)
SELECT ....
go
IF @@rowcount > 0
Furthermore say that the network connection drops between the batches. The check on @@rowcount would not be reliable. For some reason, they made the rule so that any retrieval of @@rowcount in the first batch is considered unreliable, although in your case there should not be an issue.
While this may be considered a flaw in SQL Server, there is a simple remedy: Wrap the operations in BEGIN TRANSACTION and COMMIT TRANSACTION, so that either both the rows and the rowcount are inserted or none of them. The error will still be there, but that is just what can happen in the cloud.
For application code, you should have your own retry code that backtracks and reconnects and hides the problem for the user as much as possible.