In case you ever get the error NOT_ENOUGH_RELICS_4 on an artifact with a capped number of upgrades (usually up to lvl 40) you can manually level them 1 level at a time (instead of the percentage) and it will not happen. Something I found out after fiddling with it for a bit.
The max upgrade thing could be a rounding error where its requesting to use 1,000,000 relics when you only have 999,999. So it could be going one upgrade higher so the total cost of the upgrade is higher than what you have. That's just my 2 cents, I don't know for sure.