Start by indenting the final line one place more:
for i in range(1, n):
for j in range(n-1-i):
print(' ', end="")
for j in range(1, i, 1):
Tah way, it will be executed at the end of every trip round the outer loop rather than ones after the loop has ended.
Then look at the pattern it generates.
How many rows does it have for a given input? How many should it have?
Think about what your code does and what your assignment asks you to produce: for 12 blocks, you need four rows - and you haven't looked at that at all.
I'd start by ignoring the "pyramid" entirely, and get it printing the right number of rows first,
Then that works, start getting it to print the right number of stars.
When that works, I'd look at printing the right number of spaces at the start.
Focus on one thing at a time, and get it working and tested before you move on to another. It's a lot easier to do that than try to do the whole task at once!
This may help: How to Write Code to Solve a Problem, A Beginner's Guide