How to solve Mac Apple Store repeatedly prompting for Apple ID and password?

The version of Xcode - & everything else that was already on the Mac when you got it, including the OS itself - doesn't strictly belong to you. It belongs to the Apple ID that originally 'purchased' it, even if that purchase was free.
App & OS ownership is not transferrable.

Unless your company runs an MDM solution allowing it to properly manage company-purchased apps, then the simplest solution is to wipe the entire machine & start afresh. That way everything then 'belongs' to you.

The Mac also needs to be released from the Find My & entire iCloud structure too.

See Apple KB - What to do before you sell, give away, or trade in your Mac for a comprehensive guide.

As it's a corporate Mac, you'd be best to speak to your IT department before going at this single-handed, as it will likely require the compliance of the previous user.