The 2D drawing would be two squares. Cut the smaller as a full depth pocket. The bigger square could be cut as a hole with a T-slot cutting bit. It would need a Start Depth that is the thickness of the lip plus the height of the perimeter cutting edge. Set a Lead-in point near the center of the pocket so the bit will drop to the start depth where there is no longer any material.
This seems like it will work, but the problem is that it wants to come up to “safe 0” to move to the next side, instead of going back to the lead-in spot.
Screenshot? All Z moves happen at the lead-in spot (second mouse click) and the only time the bit goes back to the clearance plane is when it’s done cutting the hole.
The second cut (T-slot) should be a hole (not pocket), all it needs to cut is what the first cut (straight bit pocket) cannot… That second cut will be full depth sideways. If that is too much, add an intermediate square to cut the undercut in two steps.