The RecursiveMutex cs_nBlockSequenceId is only used at one place in CChainState::ReceivedBlockTransactions() to atomically read-and-increment the nBlockSequenceId member:
For this simple use-case, we can make the member std::atomic instead to achieve the same result (see https://en.cppreference.com/w/cpp/atomic/atomic/operator_arith).
This is related to #19303. As suggested in the issue, I first planned to change the RecursiveMutex to Mutex (still possible if the change doesn't get Concept ACKs), but using a Mutex for this simple operation seems to be overkill. Note that at the time when this mutex was introduced (PR #3370, commit 75f51f2a63e0ebe34ab290c2b7141dd240b98c3b) std::atomic were not used in the codebase yet -- according to git log -S std::atomic they have first appeared in 2016 (commit 7e908c7b826cedbf29560ce7a668af809ee71524), probably also because the compilers didn't support them properly earlier.
At this point, the cs_main lock is set, hence we can use a plain int for the member and mark it as guarded by cs_main.