diff --git a/pandapower/results.py b/pandapower/results.py
index 99b424df..5a6a5d97 100644
--- a/pandapower/results.py
+++ b/pandapower/results.py
@@ -70,7 +70,15 @@ def verify_results(net, mode="pf"):
     suffix = suffix_mode.get(mode, None)
     for element in elements:
         res_element, res_empty_element = get_result_tables(element, suffix)
-        if len(net[element]) != len(net[res_element]):
+
+        index_equal = False if res_element not in net else net[element].index.equals(net[res_element].index)
+        if not index_equal:
+            if net["_options"]["init_results"] and element == "bus":
+                # if the indices of bus and res_bus are not equal, but init_results is set, the voltage vector
+                # is wrong. A UserWarning is raised in this case. For all other elements the result table is emptied.
+                raise UserWarning("index of result table '{}' is not equal to the element table '{}'. The init result"
+                                  " option may lead to a non-converged power flow.".format(res_element, element))
+            # init result table for
             init_element(net, element)
             if element == "bus":
                 net._options["init_vm_pu"] = "auto"

Bug in rundcpp failed to initialize result table
```python
import pandapower as pp
import pandapower.networks as nw

net = nw.case57()
pp.rundcpp(net)    
net.pop("res_gen")

# Problem by executing this
pp.rundcpp(net)

# No problem doing this
pp.runpp(net) 
```

Can anyone recreate this? I tries pp 2.2.2, pp 2.3.0.

diff --git a/pandapower/test/loadflow/test_rundcpp.py b/pandapower/test/loadflow/test_rundcpp.py
index 9625993b..7b720379 100644
--- a/pandapower/test/loadflow/test_rundcpp.py
+++ b/pandapower/test/loadflow/test_rundcpp.py
@@ -8,6 +8,8 @@ import numpy as np
 import pytest
 
 import pandapower as pp
+import pandapower.networks as nw
+import copy
 from pandapower.auxiliary import _check_connectivity, _add_ppc_options
 from pandapower.pd2ppc import _pd2ppc
 from pandapower.test.consistency_checks import rundcpp_with_consistency_checks
@@ -100,5 +102,14 @@ def test_single_bus_network():
     assert net.converged
 
 
+def test_missing_gen():
+    net = nw.case4gs()
+    pp.rundcpp(net)
+    res_gen = copy.deepcopy(net.res_gen.values)
+    net.pop("res_gen")
+    pp.rundcpp(net)
+    assert np.allclose(net.res_gen.values, res_gen, equal_nan=True)
+
+
 if __name__ == "__main__":
     pytest.main([__file__, "-xs"])
diff --git a/pandapower/test/loadflow/test_runpp.py b/pandapower/test/loadflow/test_runpp.py
index 60e4e1c4..e0f3bbb5 100644
--- a/pandapower/test/loadflow/test_runpp.py
+++ b/pandapower/test/loadflow/test_runpp.py
@@ -865,7 +865,11 @@ def test_add_element_and_init_results():
     pp.create_bus(net, vn_kv=20.)
     pp.create_line(net, from_bus=2, to_bus=3, length_km=1, name="new line" + str(1),
                    std_type="NAYY 4x150 SE")
-    pp.runpp(net, init="results")
+    try:
+        pp.runpp(net, init="results")
+        assert False
+    except UserWarning:
+        pass
 
 
 def test_pp_initialization():

pip install -e .[test]
parse_log_pytest
pandas>=0.17 networkx scipy numpy>=0.11 packaging
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
Bottleneck @ file:///opt/conda/conda-bld/bottleneck_1657175564434/work
certifi @ file:///croot/certifi_1671487769961/work/certifi
exceptiongroup==1.2.2
execnet==2.0.2
importlib-metadata==6.7.0
iniconfig==2.0.0
networkx @ file:///tmp/build/80754af9/networkx_1633639043937/work
numexpr @ file:///croot/numexpr_1668713893690/work
numpy @ file:///opt/conda/conda-bld/numpy_and_numpy_base_1653915516269/work
packaging @ file:///croot/packaging_1671697413597/work
-e git+https://github.com/e2nIEE/pandapower.git@2add154ba3d445ef7813bad9a0bcad2d62f41bb7#egg=pandapower
pandas==1.3.5
pluggy==1.2.0
pytest==7.4.4
pytest-xdist==3.5.0
python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work
pytz @ file:///croot/pytz_1671697431263/work
scipy @ file:///opt/conda/conda-bld/scipy_1661390393401/work
six @ file:///tmp/build/80754af9/six_1644875935023/work
tomli==2.0.1
typing_extensions==4.7.1
zipp==3.15.0

name: pandapower
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - blas=1.0=openblas
  - bottleneck=1.3.5=py37h7deecbd_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - fftw=3.3.9=h5eee18b_2
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgfortran-ng=11.2.0=h00389a5_1
  - libgfortran5=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libopenblas=0.3.21=h043d6bf_0
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - networkx=2.6.3=pyhd3eb1b0_0
  - numexpr=2.8.4=py37hd2a5715_0
  - numpy=1.21.5=py37hf838250_3
  - numpy-base=1.21.5=py37h1e6e340_3
  - openssl=1.1.1w=h7f8727e_0
  - packaging=22.0=py37h06a4308_0
  - pandas=1.3.5=py37h8c16a72_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - python-dateutil=2.8.2=pyhd3eb1b0_0
  - pytz=2022.7=py37h06a4308_0
  - readline=8.2=h5eee18b_0
  - scipy=1.7.3=py37hf838250_2
  - setuptools=65.6.3=py37h06a4308_0
  - six=1.16.0=pyhd3eb1b0_1
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - exceptiongroup==1.2.2
      - execnet==2.0.2
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - pluggy==1.2.0
      - pytest==7.4.4
      - pytest-xdist==3.5.0
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - zipp==3.15.0
prefix: /opt/conda/envs/pandapower

pandapower/test/loadflow/test_rundcpp.py::test_missing_gen pandapower/test/loadflow/test_runpp.py::test_add_element_and_init_results
pandapower/test/loadflow/test_rundcpp.py::test_rundcpp_init pandapower/test/loadflow/test_rundcpp.py::test_rundcpp_init_auxiliary_buses pandapower/test/loadflow/test_rundcpp.py::test_result_iter pandapower/test/loadflow/test_rundcpp.py::test_two_open_switches pandapower/test/loadflow/test_rundcpp.py::test_test_sn_mva pandapower/test/loadflow/test_rundcpp.py::test_single_bus_network pandapower/test/loadflow/test_runpp.py::test_minimal_net pandapower/test/loadflow/test_runpp.py::test_set_user_pf_options pandapower/test/loadflow/test_runpp.py::test_kwargs_with_user_options pandapower/test/loadflow/test_runpp.py::test_runpp_init pandapower/test/loadflow/test_runpp.py::test_runpp_init_auxiliary_buses pandapower/test/loadflow/test_runpp.py::test_result_iter pandapower/test/loadflow/test_runpp.py::test_bus_bus_switches pandapower/test/loadflow/test_runpp.py::test_bus_bus_switches_merges_two_gens pandapower/test/loadflow/test_runpp.py::test_bus_bus_switches_throws_exception_for_two_gen_with_diff_vm pandapower/test/loadflow/test_runpp.py::test_z_switch[True] pandapower/test/loadflow/test_runpp.py::test_z_switch[False] pandapower/test/loadflow/test_runpp.py::test_switch_fuse_z_ohm_0[True] pandapower/test/loadflow/test_runpp.py::test_switch_fuse_z_ohm_0[False] pandapower/test/loadflow/test_runpp.py::test_switch_z_ohm_different[True] pandapower/test/loadflow/test_runpp.py::test_switch_z_ohm_different[False] pandapower/test/loadflow/test_runpp.py::test_two_open_switches pandapower/test/loadflow/test_runpp.py::test_oos_bus pandapower/test/loadflow/test_runpp.py::test_connectivity_check_island_without_pv_bus pandapower/test/loadflow/test_runpp.py::test_connectivity_check_island_with_one_pv_bus pandapower/test/loadflow/test_runpp.py::test_connectivity_check_island_with_multiple_pv_buses pandapower/test/loadflow/test_runpp.py::test_isolated_in_service_bus_at_oos_line pandapower/test/loadflow/test_runpp.py::test_isolated_in_service_line pandapower/test/loadflow/test_runpp.py::test_makeYbus pandapower/test/loadflow/test_runpp.py::test_test_sn_mva pandapower/test/loadflow/test_runpp.py::test_bsfw_algorithm pandapower/test/loadflow/test_runpp.py::test_bsfw_algorithm_with_trafo_shift_and_voltage_angles pandapower/test/loadflow/test_runpp.py::test_bsfw_algorithm_with_enforce_q_lims pandapower/test/loadflow/test_runpp.py::test_bsfw_algorithm_with_branch_loops pandapower/test/loadflow/test_runpp.py::test_pypower_algorithms_iter pandapower/test/loadflow/test_runpp.py::test_zip_loads_consistency pandapower/test/loadflow/test_runpp.py::test_zip_loads_pf_algorithms pandapower/test/loadflow/test_runpp.py::test_zip_loads_with_voltage_angles pandapower/test/loadflow/test_runpp.py::test_xward_buses pandapower/test/loadflow/test_runpp.py::test_pvpq_lookup pandapower/test/loadflow/test_runpp.py::test_get_internal pandapower/test/loadflow/test_runpp.py::test_storage_pf pandapower/test/loadflow/test_runpp.py::test_pp_initialization pandapower/test/loadflow/test_runpp.py::test_equal_indices_res pandapower/test/loadflow/test_runpp.py::test_ext_grid_and_gen_at_one_bus pandapower/test/loadflow/test_runpp.py::test_dc_with_ext_grid_at_one_bus pandapower/test/loadflow/test_runpp.py::test_init_results_without_results pandapower/test/loadflow/test_runpp.py::test_init_results pandapower/test/loadflow/test_runpp.py::test_wye_delta pandapower/test/loadflow/test_runpp.py::test_line_temperature pandapower/test/loadflow/test_runpp.py::test_results_for_line_temperature
pandapower/results.py
pandapower/results.py