Here is a rework of your script that works with your sample data tables. The main change is the addition of the Try() function, that keeps the code from stopping when an error within the Set () occures.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Need to update data table based on bins in recipe, name and get rid of Bin Cols no data was collected, bins greater that number defined by bin size list
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Referance: https://community.jmp.com/t5/JMP-Scripts/Find-amp-Replace-for-Column-Names/ta-p/217124
b = Data Table( "BinSizeList" ):Name( "CntBins" ) << get values;
Show( b );
Show( b[1] );
bnum = Data Table( "BinSizeList" ):Name( "Label" ) << get values;
Show( bnum );
bsize = Data Table( "BinSizeList" ):Name( "Bin_Label" ) << get values;
Show( bsize );
Data Table( "LPD_Data" ) << Select Columns( ALL );
cols = Data Table( "LPD_Data" ) << Get Selected Columns();
Show( cols );
// Nested loop does not work? Error on "set name" comand only when nested j loop is included. Works fine if j for statement is removed and [ j ] replaced with a valid number
For( i = 1, i <= N Items( cols ), i++,
For( j = 1, j <= b[1], j++,
Try(
cols[i] << set name(
Munger(
Char( cols[i] ), // << get name,
1,
Eval( Char( bnum[j] ) ),
Eval( Char( bsize[j] ) )
)
)
)
)
);
Jim