What is happening is due to double-precision floating-point type of number javascript uses.
When you join those numbers and enter in a cell, I guess google spread Sheet is considering this string (which only contains number and comma) a number and converting this string to number. At this point, this is what is happening: Large numbers erroneously rounded in Javascript.
If you want to keep it as you want, add some non numeric value that is not supposed to be in number convention i.e add quotations "36776,37245,45948,48877"
sheet.getRange(5,11).setValue('"' + array.join() + '"');
Or remove the comma entirely to keep the numbers safe from rounding automatically.
sheet.getRange(5,11).setValue(array.join().replace(/,/g, ""));