Yes one side can compensate for something occurring on the opposite side of the body.
Hip compensation effects everything upstream so yes it can affect the shoulder.
If you are seeing issues at the hip and shoulder you need to back up and look at the spine.
Deviations in your spine will shut down the primary engines of the hip and shoulder.
You need to work on those areas more than once a day,
They are not able to hold the change for long periods of time in the beginning it needs reminders.
You are breaking the bad habit of the poor position in that area and making a change in position.
Just as working on technique with a skill it takes skill/drill work, time, and doesn’t come automatically.
Keep chipping away at it.