You have to add the starting location of your subsection to the returned location if you subset the overall signal, The loop you show will only pass a point; you would need to set a width/length of the timeseries to do this way.
Try something like
locs=[locs1 locs2]; % combine the two sets into one
[locs,iloc]=unique(locs); % find the unique locations between the two
pks=pks(iloc); % get corresponding values
It would be beneficial and folks would probably chime in with far more creative solutions if you would attach the signal and define more specifically just what is the criteria by which a peak is/is not to be chosen. findpeaks is pretty flexible; more tweaking on its inputs might make things "more simpler" and, in particular, more repeatable from trace to trace.