Check whether the change took effect before trying it again. Open Settings > Cellular or Mobile Data and inspect the selected line.
If you were installing
Check whether a new profile is present. Use a stable connection and follow "Cellular plan cannot be added" if the profile is missing. Do not repeatedly scan a code that may already have installed.
If you were changing the data line
Choose the intended line under Cellular Data or Mobile Data. See "Choose the right SIM for mobile data". Change one setting at a time so you can see which action fails.
Restart the phone and check for an available iOS update if the error persists. Try another trusted connection if installation is involved.
Contact support with the exact action, error, phone model and iOS version. Keep existing profiles installed while the problem is investigated.