The use of families looks like it is the reason it's not working, you are not specifying which array to grab the data from when you use a family. If you want to do it per layout then you should run that logic through the specific array that has the data.
The way to do it with one layout is to keep refilling the one array with the data from the correct level file. So what you're doing for level 1, you call it again from level 2. The way to change the data in the array could be to set a global variable for level number then restart the layout, if level=1 then grab from json1 and if level = 2 then from json2 etc.