Some suggestions from PageSpeed/Lighthouse may not be feasible or necessary for every site. It should be used as part of the overall performance picture, but not as the only decision-making criteria. 4000+ DOM nodes may or may not be acceptable, depending on the web application.
Real-world performance is more important. Instead of focusing solely on PageSpeed scores, prioritize improving the actual experience for users.
In general, look for ways to create DOM nodes only when needed, and destroy nodes when they're no longer needed.
If you're shipping a large DOM tree, try loading your page and manually noting which nodes are displayed. Perhaps you can remove the undisplayed nodes from the initially loaded document and only create them after a relevant user interaction, such as a scroll or a button click.
Use a library like react-window to minimize the number of DOM nodes created if you are rendering many repeated elements on the page.
Reference: https://developer.chrome.com/docs/lighthouse/performance/dom-size