The problem with this approach is that it's pretty much impossible to get statistical software to "generate" a line that doesn't "fit" the data, because there are an infinite number of possibilities.

Additionally, what you're proposing is merely a "roundabout" way of doing what regression analysis tells you anyway....

Some approaches you could take, any of which are fraught with pitfalls (i.e., they're arbitrary):

If you set the slope (b) = 0 for the linear equation y = bx + a, you'll be left with a simple equation such as y = a, where "a" is the y-intercept. Subtract "a" from the y-coordinate of all the data points, and you've got the residuals.

You could also set "a" to be the mean of y, and then do the same subtraction as above.

You could also set "a" to anything you want....

In any case, I think you'll find that the Mann-Whitney test will be significant as well (it's very comparable in power to the t-test when n is large), and quite frankly I'm not sure exactly what this is telling you....