I will call $y$ the width we are looking for. The reason why you get $y=122$ is because you forgot to multiply by 2 (the value per square feet) the area of the path.
I will call $x$ the length of the courtyard and $w$ the width of the path. To compute the area of the path we take two times the length of the courtyard and multiply it by the width, and then subtract the considered area of the path to the width of the courtyard, multiply this by the width and by two and add it to the above:
$$A = 2wx + (y-2w)2w$$
is the area of the path, so its value is $2A$ (we have to multiply by 2, the price of the square feet). We are given that changing $w$ to $2w$ the new value (which again we have to multiply by 2, the price of the square feet) is $2A + 984$, so we obtain the equation:
$$2(2(2w)x + (y-2(2w))2(2w)) = 2(2wx + (y-2w)2w) + 984$$
which solving for $x = 60$ and $w = 3$ yields $y = 40$, the correct answer.
Notice that if instead you don't multiply by the price of the square feet when needed, then the equation that you obtain is:
$$2(2w)x + (y-2(2w))2(2w) = (2wx + (y-2w)2w) + 984$$
which solving for the same values of $x$ and $w$ yields $y = 122$, the incorrect answer you got.