As attached in the screenshot; Sugar Cane can be planted under water, as long as there is another water block diagonally below the block the Sugarcane is used on.
It seems that the Sugar Cane is checking that it is being planted next to water, but failing to ensure it is not currently submerged in water.
The Sugar Cane will not break with block updates.
Related issues
duplicates
Attachments
Comments

This is an intended feature. Sugar Cane has water-displacing properties, and can be placed on sand/dirt as long as there's an adjacent water source block on the same y level as the sand/dirt.
Certain squid farms use this feature to obtain ink sacs, and it can be used to create underwater paths too.