JPEG should be fine with those dimensions (did you try mozjpeg's cjpeg?), but WebP is contained in a RIFF format and has a limit of 16383 pixels in either of its dimensions. Don't know the technicals of AVIF, but being derived from a video format, it's not going to be designed for large sizes in the first place, and I don't know if it also uses RIFF for the same limits.
PNG and JPEG XL are actually made for, well, still images; JPEG XL especially has no practical limitation on dimensions, it'll take whatever you can throw at it, given you have the hardware to process it. JPEG XL is either lossy or lossless at your option ;)