Sure, but their energy budget includes everything. They don’t have the luxury of importing energy others invested into decades ago when convenient and having it be off balance sheet like Denmark does.
China would actually have to build stuff to do that. Denmark can just pretend it doesn’t exist.
That argument doesn't make any sense. Why would the same arguments about investments not apply to a single country? Moreover, considering the size of the China (both geographically and economically) it should be much easier to do this, because they don't have to rely on the decisions of others but can make decisions themselves.
I think it's analogous (though obviously a very different scale) to the difference between me, as a single individual, being able to build and install a grid-connected PV* system for my home where I get to claim "net zero" energy use without having to care who uses what I export or what generates for me at night, vs. a genuinely off-grid system where I need to own the storage and have to deal with it when whatever solution I invest in is insufficient for my needs.
Of course, both China and Denmark can do much better than me at every level, but like I said, analogy.
* I think theoretically I am allowed to install a wind turbine, but same applies.
This is the biggest issue I have with headlines "[country] got all of its electricity from [some renewable] today!" when the reality is they rely on some other supply when [some renewable] has zero output.
Like you say, a lot of countries get a pass because a neighbour invested billions and decades building nuclear. Or else they fall back to coal/gas.
It's not clear what your issue is or whether you would prefer that country X used absolutely no renewables whatsoever and derived all their energy needs including transport and electricity from damaging and limited fossil fuels.
China would actually have to build stuff to do that. Denmark can just pretend it doesn’t exist.