The Fed is independently run, but part of the federal government. Specifically, any money it makes or loses goes to the US Treasury:
https://www.wsj.com/articles/higher-interest-rates-fuel-loss...
https://www.wsj.com/articles/higher-interest-rates-fuel-loss...
https://www.stlouisfed.org/in-plain-english/who-owns-the-fed...