The line-in is analog to digital, so it has no idea what the original digital source is. When it gets into the Sonos device, it is resampled to 16/48. So I don’t know why you would wish to play through such a Rube Goldberg setup when you could just stream 24/48 directly from the Apple Music source using the Sonos app.
Oh and PS, 24/48 is lossless, as is 16/48, 16/44.1, etc. Lossless encoding is not dependent on the sample rate or bit-depth. It is dependent on the codec, which basically boils down to Nyquist-Shannon; which states there is no loss of data for any frequencies under ½ the sample rate. Since 20 KHz is the very upper limit of human hearing, any sample rate above 40 KHz contains everything audible to humans, and is considered lossless. Anything above that sample rate is a waste of space, bandwidth, and CPU cycles, unless you are marketing to dogs or dolphins.