In this work, we propose a calibration and beamforming (BF) algorithmic flow for a millimeter-wave (mmWave) phased array receiver at 28 GHz by integration of digital domain algorithms. We aim to enable robust beamforming (RBF) in the presence of wideband in-phase/quadrature imbalance (IQI) and with both mutual coupling between array elements and coupling to their surroundings, where a simple model of analytical antenna coupling does not hold. By sparse grid measurements of continuous-wave (CW) at intermediate frequency (IF), the phase mismatch of the array is estimated using discrete Fourier transform (DFT), and the gain mismatch is estimated by the power of each received channel. Using interpolation of the estimated mismatches, an inverse distortion matrix is constructed and used to calibrate angle-dependent gain/phase (GP) mismatches of the array. The latter is preceded by an adaptive wideband IQI compensation, which is applied in every received channel separately. Utilizing the distortion matrix, minimum variance distortionless response (MVDR) direction of arrival (DOA) estimation is applied with corrected steering vectors. Finally, a modified version of the principal component beamformer (PC-BF) is used by correction of the autocorrelation matrix of the received signal. By over-the-air (OTA) measurements using a 4-element phased array receiver, up to 41.3 dB signal-to-interference plus noise ratio (SINR) improvement is achieved using the proposed algorithmic flow.