If you change a chain, that hasn’t been treated like some sort of princess, and don’t change the cassette, at the same time, you get the slippage you describe. The chain and cassette wear in unison, and form a ‘mesh’. Putting a new chain on an old cassette will not have the same wear pattern / ‘mesh’ and slippage happens under proper power.
One has two choices (starting from new/new):
A) Ride happily until you get slippage (the wear on the cassette will not be apparent). Do not measure the chain (except for interest/data gathering). Replace chain and cassette together. I did this in 2017 and changed both at about 3600 miles. My current 'matched' set has done about 2200 miles but they will be changed 'early' (ie before any slipping experience) for the long rides of the late spring - I don't want slipping to start on the way up Snowdon/Pen-y-pas in the middle of a 600 qualifier.
B) Ride happily for 1000 miles and then change the chain (even if, when measured the elongation is less than 0.5%). Do not discard the old chain. The new chain should be fine. If it is not - test before riding any distance from home - refit old chain and continue on forced option A (above). Replace the second chain after about the same distance. Ride the third chain following protocol in option A (above). Last year I did this (9sp) and changed the chains at 1500, 1300 and then both 1300 miles later (the cassette having done 4100 miles by then).
Just going on these data, one can see that running both together is probably more economic unless the cassette's for your bike are expensive. It's certainly less hassle - no measuring required - but keep an eye on distance ridden since the change and consider bringing replacement forward before an important/long ride.
Commenting on rr's analysis.
From new, both chain and cassette wear, but because a new/nearly new chain is not elongated the cassette experiences much less wear in the early days of a chain. And so by replacing the chain before it's elongated much, you will find that putting a new chain on a slightly worn (ie 1000 miles, say) cassette will not not result in "slippage under proper power".