The Problem
I guess that since you are reading this article you’re looking for the solution for the error in the title of the post: Calculation error on quote Q-00161: “UNAUTHORIZED”.
The Solution
There is this Knowledge Article from Salesforce: Salesforce CPQ Authorize New Calculation Service best practice that you should check in the first place. And yet, there is another one: Error ‘Invalid nil argument: OAuth Refresh Token’ in CPQ Quote Line Editor
For me, I did not have any “SteelBrick CPQ” in the Connected Apps OAuth Usage section.
Go to:
Setup -> Connected Apps -> Connected Apps OAuth Usage
And you will probably NOT see any CPQ in there, but you should!
https://brick-rest.steelbrick.com/oauth/auth
or
https://test.brick-rest.steelbrick.com/oauth/auth
In order to fix the problem, go to the
Salesforce CPQ Settings > Pricing and Calculation
and reauthorize the new calculation service.