Vendor interoperability is one of the desired future characteristics of optical networks. This means that the transmission system needs to support a variety of hardware with different components, leading to system uncertainties throughout the network. For example, uncertainties in signal-to-noise ratio and laser linewidth can negatively affect the quality of transmission within an optical network due to e.g. mis-parametrization of the transceiver signal processing parameters. In this paper, we propose to geometrically optimize a constellation shape that is robust to uncertainties in the channel conditions by utilizing end-to-end learning. In the optimization step, the channel model includes additive noise and residual phase noise. In the testing step, the channel model consists of laser phase noise, additive noise and blind phase search as the carrier phase recovery algorithm. Two noise models are considered for the additive noise: white Gaussian noise and nonlinear interference noise model for fiber communication. The latter models the behavior of an optical fiber channel more accurately because it considers the nonlinear effects of the optical fiber. For this model, the uncertainty in the signal-to-noise ratio can be divided between amplifier noise figures and launch power variations. For both noise models, our results indicate that the learned constellations are more robust to uncertainties in channel conditions compared to a standard constellation scheme such as quadrature amplitude modulation and more importantly standard geometric constellation shaping techniques.