Problems to reach the data from nested structure field

I don’t get the data from a nested structure field.
This is the saved data:


  istreet: Musterstraße
  ihousenumber: 4
  izip: 42283
  icity: Musterstadt
      cpersontitle: ""
      cpersonname: Max
      cpersonsurname: Muster
      cpersonphone: +49(0)030 589 523

I try to get these data with $accordeon->cpersoninfos()->toStructure(); the Detailinfos I get without problems with $accordeon->detailinfos()->toStructure();.

It looks that I have a empty array in between.
This is I what I get dumped with $accordeon->cpersoninfos()->toStructure():

^ Kirby\Cms\Structure {#888 ▼
  +data: []
  #caseSensitive: false
  #pagination: null
  #parent: Kirby\Cms\Page {#379 ▶}


You should post the complete code here, it doesn’t make sense that you call both the main at the nested structure on $accordeon (whatever $accordeon is in this context).

Here is an example: How to loop through a nested structure? - #3 by texnixe

Thank you for your example it helped.
I had a mistake in the nesting the second foreach and I used $accordeon->cpersoninfos()->toStructure() instead of referencing to the foreach one level up.