If not then first I need to invest in a used D850, which is also
available before buying this lens.
Equipment wise, the camera is not the weak link here, the lens is. Yes, the D850 will focus marginally better than the D5600 with the same lens, but a better lens on the D5600 will show more improvement than the less capable lens on a D850. If you want better performance, consider a better lens. But before you go chasing better photos by buying expensive gear, be sure you're getting the most out of what you're currently using!
Whether you upgrade a body, a lens, or both, as long as you use the same general settings and shooting techniques you're only going to improve how accurately and consistently from shot-to-shot the high contrast leaves are focused in situations like the first example.
The first image is focused on the area of highest contrast in the scene. That's not the bird near the center of the frame.
I'm guessing you were using some form of area focus or single point with surrounding assist "points"? Either that or the scene was so dim that the AF focused on anything it could find that had enough contrast for it to function.
The second image is focused on the area of highest contrast in the scene, which is the leaf at the center of the frame.
The scene also appears to be brighter, which gives the AF system more contrast to work with.
Most cameras, both DSLRs and MILCs, will focus on the area of highest contrast within the active AF areas.
Keep in mind that the little squares you see in the viewfinder are usually significantly smaller than the areas they represent. In reality, with most modern AF systems with high numbers of focus "points", coverage is gapless from many "points" to the next. Sometimes the coverage of two adjacent "points" will even overlap to one degree or another.
Here's a map of the 19-point AF system found in Canon's 7D and 70D APS-C DSLRs. AF systems in other models, even those from other manufacturers, work similarly.¹
Most other PDAF systems with a higher number of AF points are similar. The 7D AF system is a good example to use to illustrate how such AF systems work because with 19 AF points, all of them cross type, it is not so complex as to be unwieldy to diagram.
The diagram at the top shows the points as they appear in the viewfinder, with identifying numbers added to the left of each point. The middle left chart shows which areas of the focus array at middle right apply to each focus point (please note that the light falling on the focus array is directed by multiple sets of micro-lenses when the light enters the focus array, so the physical arrangement of the lines on the PDAF array do not directly correspond to a specific "point" in the viewfinder). The vertical elements for point 1 are a5 and b5. The horizontal elements for point 1 are a2 and b2. The diagram at the bottom shows the actual areas of sensitivity for each of the much smaller points displayed in the viewfinder. When you have the far left point selected (point 1 in the top diagram), the area of sensitivity includes everything in the horizontal and vertical blue rectangles that pass over that point. Notice that the horizontal line for point 1 is shared with point 3 and the area of sensitivity for point 1 extends completely to point 3! Also notice that all of the area of horizontal sensitivity is directly over or to the right of point 1, there is no horizontal sensitivity extending to the left beyond the viewfinder square for point 1.
AF systems with even more "points" often have even more overlap. Here's a simplified map of a 61-point system used by the Canon 1D X Mark II and 5D Mark IV that shows both the squares seen in the viewfinder as well as the coverage areas:¹
The light gray squares are all one sees in the viewfinder, but the darker rectangles show actual areas of sensitivity.
As you can see from these examples, even when a single AF "point" is selected the are that the camera is using to detect contrast is larger than the representation of that area of sensitivity in the viewfinder. If you are using multiple AF points in "zones" or "areas", then there's an even larger part of the frame that the AF system is using to find a high contrast area.
¹ Nixon doesn't publicly publish similarly detailed charts about their PDAF AF systems showing such things as the actual area of sensitivity of each AF "point" or which AF points are sensitive at which apertures, etc.