How to analyse the time complexity of an algorithm based on the input values in addition to input size
If we analyze a Time Complexity dependent also on the values of a given input, then as you say a more defined notation would be O(max(n)).
Though, saying O(max(n) + n) in O notation means O(max(n))
So it will still be accurate, since in both outcomes the Complexity is linear in the given input.