As @ martin.macko points out, you (erroneously) assume that pow(pow(x, 1/3), 3) == x. This is not due to floating point errors. In fact, performing a quick check, we find that there is (probably) only a small number of integers for which this is true:
good = [x for x in range(10**7) if pow(pow(x, 1/3), 3) == x]
good_cubes = [x**3 for x in range(1000) if pow(pow(x**3, 1/3), 3) == x**3]
# len(good) = 50
< <22 >
0, 1, 2, 6, 8, 9, 12, 16, 19, 23, 25, 27, 35, 44, 65, 66, 72, 73, 76, 83, 85, 91, 94, 96, 117, 127, 130, 139, 142, 147, 158, 170, 175, 513, 514, 520, 539, 547, 549, 551, 553, 562, 563, 576, 581, 601, 605, 663, 690, 699
good_cubes
0, 1, 8, 27
, 27, , . :
next_cube = ceil(x**(1/3))**3 ceil - math.