Variable in wg results in invalid argument in wg

Below i have attached picture for better reference where in formula editor with in wg function’s argument if used inside (bracket symbols) with the global variable then global variable becomes unrecognizable. Or if there is something wrong could you please point to it.or if anyone know alternative way of achieving same in json please let me know.
Purpose/target :- get the element in the json array with element to get which location number is stored in global variable number which you can increase or decrease count to traverse through the different elements of json array. Thank you

I am looking for way to include the number that is stored in global variable inside the [ ] brackets of location array in formula but it gives me error. here is similar reddit post however it didn’t make much sense to me since it was done in $fl()$ for-loop if i understand correctly reddit post answered by tored - JSON for loop )

There is interesting way to solve this. if anyone want to know just reply this I just solved this(probably it’s long since i like to make solution longer).