Urban immigrant enclaves can flip politically on a dime. What matters in Queens and Brooklyn is probably the most dissimilar to the rest of the US. I doubt the result will be this close but there’s a scenario where the diversity of NYC could often start working against Democrats instead of for them.
I think it isn't happening evenly in every metropolitan area, with the two greatest predictors being that more educated metropolitan areas (like Boston and San Francisco) and those with less recent immigrant background are lagging, but I don't think it's only NYC which is seeing a backlash. In the context of the national environment, I think Democrats did quite poorly in both the LA and Chicago areas in 2022.
(I think this is also associated with a pretty tight pattern where areas whose population is declining start trending Republican -- it's been pretty widely reported that NYC, LA, and Chicago are all losing population. I think this is not as true for the Bay Area.)
Urban immigrant enclaves certainly do not flip "on a dime", but they can have their own trends dissociated from national ones based on parochial issues they care about.