It seems that is an issue rather related to ELPA than to BFGS. specifically, because BFGS involves a diagonalization of the Hessian whereas LBFGS does not. When BFGS works with ScaLAPACK, the problem stems most likely from ELPA. There have been issues observed with CP2K/ELPA, recently. So, just use ScaLAPACK, since the advantage of using ELPA instead of ScaLAPACK is most likely minor for your case.